StyledLabel does not support icons. I can use JLabel to setIcon() and setText(null) and I have a method to check in case the text is null I expand the image to the size of the JLabel, but with StyledLabel it get the following error
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.jidesoft.plaf.basic.BasicStyledLabelUI.buildStyledText(Unknown Source)
at com.jidesoft.plaf.basic.BasicStyledLabelUI.getPreferredSize(Unknown Source)
at com.jidesoft.plaf.basic.BasicStyledLabelUI.layoutCL(Unknown Source)
at javax.swing.plaf.basic.BasicLabelUI.paint(Unknown Source)
at javax.swing.plaf.ComponentUI.update(Unknown Source)
at javax.swing.JComponent.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintChildren(Unknown Source)