Stop JLabel self-resizing in GroupLayout
843806Feb 25 2009 — edited Feb 26 2009Hi all.. I've been struggling with this for some time and would really appreciate some help...
I am using NetBeans 6.5 GUI Builder - in Free Design (Group Layout).
I have a JInternalFrame containing a JPanel which in turn contains a JLabel.
The panel and label both span the width of their containers (to the preferred distance inserts) and both have been set to be Horizontal and Vertical Resizable in the properties.
PROBLEM: When text is put into the label that it can't fit then the label grows until it can. This makes the panel grow to fit the new label width. And now the panel doesn't fit in the frame (causing scrollbars to appear if the panel has any).
QUESTION: Is there any way to make a JLabel not auto-grow in width to fit all of its text, yet still have it Horizontal Resizable in the layout properties?
i.e. Have it Resizable only in response to frame resizing etc., NOT in response to its own text content.
Thanks
Edited by: gusman on Feb 25, 2009 8:15 AM