How to right-justify icon in a JLabel?

You should use:

label1.setHorizontalTextPosition(SwingConstants.LEFT);

(Set the position of the text, relative to the icon)

Leave a Comment