I have a JCheckBox with a custom icon. The dimensions of the icon are 32x32 pixels.
When I set some text with horizontal alignment RIGHT, the text is not respecting the icon's width.
How can I make sure the text does not overlap with the icon and instead be layout next to the icon?
My checkbox is rather straightforward:
JCheckBox cbx = new JCheckBox(new ImageIcon(getClass().getResource(pathToFile)));
cbx.setText("some label");
Thanks.