JComponent () { myTextLabel = new ErrorLabel(); myTextLabel.setOpaque(true); myTextLabel.setBorder(JBUI.Borders.empty(1)); myInfoLabel = new ErrorLabel(); myInfoLabel.setOpaque(true); myInfoLabel.setBorder(JBUI.Borders.empty(1, DEFAULT_HGAP, 1, 1)); myInfoLabel.setFont(FontUtil.minusOne(myInfoLabel.getFont())); JPanel compoundPanel = new OpaquePanel(new BorderLayout(), JBColor.WHITE); myIconLabel = new IconComponent(); myInfoLabel.setHorizontalAlignment(SwingConstants.RIGHT); JPanel compoundTextPanel = new OpaquePanel(new BorderLayout(), compoundPanel.getBackground()); JPanel textPanel = new OpaquePanel(new BorderLayout(), compoundPanel.getBackground()); compoundPanel.add(myIconLabel, BorderLayout.WEST); textPanel.add(myTextLabel, BorderLayout.WEST); textPanel.add(myInfoLabel, BorderLayout.CENTER); compoundTextPanel.add(textPanel, BorderLayout.CENTER); compoundPanel.add(compoundTextPanel, BorderLayout.CENTER); return layoutComponent(compoundPanel); }