Content received from: http://JavaFAQ.nu/java-article34.html


Question: JLabels: when I add ''too much'' text I can't see all of it.
Tuesday, January 21, 2003 (17:36:05)

Posted by jalex

Question: JLabels: when I add "too much" text I can't see all of it.
Also, how to break line into a few pieces?
Possible solutions?


Answer: The getPreferredSize() method of the JLabel will return you the minimum size.
The size that required to display the text in full. But you need to choose a layout
that will not respect those sizes. Not so easy question as well Smile
It was suggested to use Jlist instead of JLabel and disable it with setEnabled(false). The selection will be disabled and you need to add your lines as lines to data model of JList.
Probably you need to take care about UI properties of JList (copy fro JLabel) to make it looking the same...
--
Sergey
******************************************************************
Our older tips: March 22, 2001 - Oktober 21, 2002 read here.
All published and not published on site tips you can find here