Results 1 to 5 of 5
Thread: How to wrap text in a JList
- 05-10-2011, 03:10 PM #1
Member
- Join Date
- Dec 2009
- Posts
- 14
- Rep Power
- 0
How to wrap text in a JList
I have a JList but i dont want it to have a horizontal scroll bar, i want the text that doesnt fit to be wrapped onto the next line. Does anyone know the code that will wrap it? I know in a TextArea you can use ".setLineWrap(true);" to make it wrap but its different for JLists
Any help would be appreciated
- 05-10-2011, 03:55 PM #2
Member
- Join Date
- May 2011
- Location
- Munich
- Posts
- 15
- Rep Power
- 0
Just use create a CellRenderer and return a TextArea instead of a Textfield (or whatever it is). Then setLineWrap(true).. should work i think. How does it not work?
read my blog : www.blue-walrus.com
- 05-11-2011, 02:58 AM #3
Member
- Join Date
- Dec 2009
- Posts
- 14
- Rep Power
- 0
Yea, it works for TextArea but im looking to wrap text in a JList, however it is different than a TextArea so the setLineWrap doesnt work for JLists, i was wondering if there was a line of code to wrap writing in a JList or if you have to do something else
-
- 05-11-2011, 02:48 PM #5
Member
- Join Date
- Dec 2009
- Posts
- 14
- Rep Power
- 0
Similar Threads
-
word wrap text in rows of Jtable
By pink123 in forum AWT / SwingReplies: 3Last Post: 03-10-2011, 07:20 PM -
JList item text does not truncate when it's HTML
By edsporty in forum New To JavaReplies: 1Last Post: 03-02-2011, 08:09 PM -
Populating a JList from a text file - Netbeans
By Ben1 in forum AWT / SwingReplies: 1Last Post: 01-13-2011, 03:30 PM -
JTextArea Wrap Around or something?
By Krooger in forum New To JavaReplies: 6Last Post: 11-28-2009, 04:29 AM -
How do I display a JList with icons and text?
By aneesahamedaa in forum AWT / SwingReplies: 2Last Post: 09-04-2008, 08:49 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks