File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JList maximum size? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JList maximum size?" Watch "JList maximum size?" New topic

JList maximum size?

Marcus Hathaway
Ranch Hand

Joined: Jun 07, 2005
Posts: 89
Hello everybody, I'm currently having problems with a JList. Background: It pulls Strings from a database and displays them on the JList as the String array. It has a scroll bar attached which seems to work fine. However, when i get over say 25 items in the JList it does not display them. I can't scroll down to them as the scoll bar thinks its at the end. However, i know the items are in the list, as if i simply use the keyboard down key, i know i am selecting items further down the list, even though i cannot see them. Anybody any suggestions as to how i can make the JList show all the items? Or is there a limit in the number of items that can be placed in a JList? Thanks in advance for any advice!
Marcus Hathaway
Ranch Hand

Joined: Jun 07, 2005
Posts: 89
I've just noticed that my scroll bar on my JList doesn't seem to have a blue pull down thing(!) I've tried the same code on other things and the blue movable bar is there. Does anybody think this may have something to do with why only 20 or so items can be displayed?! Any suggestions would be most appreciated as i'm pulling my hair out trying to solve this! Cheers!
I agree. Here's the link:
subject: JList maximum size?
Similar Threads
IE7 drop down problem
JTree + JList in JScrollPane - Out of Sync
How to show JCheckBox component as elements of a JList ?
Fixed length for drop-down list
Scrolling in Java