Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   JList max width problem (http://www.programmingforums.org/showthread.php?t=8840)

.TD Mar 13th, 2006 9:26 AM

JList max width problem
 
I have had a quick search and can't find anything really useful. I am making a IRC style chat app for some coursework and have a JList inside a ScrollPane in the center of a BorderLayout jPanel (on the right (LINE_END) of a BorderLayout on the main form) to list all the usernames of clients connected to the server.

My problem is that I cannot seem to make the width of the jList fixed, or adhere to a maximum value. It is always the width of the longest text in the list, it doesn't matter if the scrollpane is set to even always display horizontal scroll bars that doesn't work. Anyone have any ideas? I'll add code if need be.

.TD Mar 13th, 2006 10:47 AM

Ok, never mind, I've sorted it, I just needed to set the list's prefered size. Although it was strange that it didnt obay the setMaximumSize.


All times are GMT -5. The time now is 5:13 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC