Here’s the problem: I have a drawing area that will display graphics (custom drawing). When the application is first started, no graphics are selected to be drawn, and the drawing area is set to a default (preferred) size. So as not to confuse the user, I’d like to display some text (something like “No Image Selected”) until the real graphics are drawn. The drawing window is contained in a JScrollPane, so it can also be resized. Is there a way to add text (a JLabel?) to the drawing area and have it automatically scale to fill the extent of the drawing area?
Here’s the problem: I have a drawing area that will display graphics (custom drawing).
Share
See the link http://java-sl.com/tip_adapt_label_font_size.html
It shows how to adapt
JLabel'sfont size when it’s resized.