JComponent () { myTextLabel = new ErrorLabel(); myTextLabel.setOpaque(true); myTextLabel.setBorder(JBUI.Borders.empty(1)); myIconLabel = new IconComponent(); JPanel panel = new OpaquePanel(new BorderLayout(), JBColor.WHITE); panel.add(myIconLabel, BorderLayout.WEST); panel.add(myTextLabel, BorderLayout.CENTER); return layoutComponent(panel); }