How to add a horizontal gap with a JLabel

java, jlabel, swing, swingx

Solution

I have found the solution!

setBorder(new EmptyBorder(0,10,0,0));

Thanks everyone!

Problem

I have a JLabel (actually, it is a JXLabel). I have put an icon and text on it. `<icon><text>` Now I wand to add some spacing on the left side of the component, like this: `<space><icon><text>` I DON'T accept suggestion to move the JLabel or add spacing by modifying the image. I just want to know how to do it with plain java code.

Original source