![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Feb 2006
Location: UK
Posts: 36
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Feb 2006
Location: UK
Posts: 36
Rep Power: 0
![]() |
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.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|