JComponent () { JPanel iconPanel = new JPanel(new BorderLayout()); iconPanel.add(new JBLabel(AllIcons.General.WarningDialog), BorderLayout.NORTH); JEditorPane messageArea = new JEditorPane(); messageArea.setEditorKit(HTMLEditorKitBuilder.simple()); messageArea.setEditable(false); messageArea.setPreferredSize(JBUI.size(500, 100)); messageArea.setBorder(new CompoundBorder(BorderFactory.createLineBorder(Gray._200), JBUI.Borders.empty(3))); messageArea.setText(UIUtil.toHtml(myBuilder.message)); JPanel panel = new JPanel(new BorderLayout(JBUIScale.scale(3), 0)); panel.add(iconPanel, BorderLayout.WEST); panel.add(messageArea, BorderLayout.CENTER); return panel; }