How to put the text of a JLabel under its icon
12,239
See this:
Basically, use this in your case:
north.setHorizontalTextPosition(JLabel.CENTER);
north.setVerticalTextPosition(JLabel.BOTTOM);
Author by
Bilal Syed Hussain
Updated on June 03, 2022Comments
-
Bilal Syed Hussain almost 2 years
I trying to put the text of a JLabel under its icon (centered) at the momemnt I can get this
using
JLabel north = new JLabel("North")
I tried using html in the label
JLabel("<HTML><BR>North</HTML>")
but it is not aligned properly. Any suggestions?