wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes SetVisibleRowCount ignored Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "SetVisibleRowCount ignored" Watch "SetVisibleRowCount ignored" New topic
Author

SetVisibleRowCount ignored

Marc Beck
Ranch Hand

Joined: Sep 09, 2006
Posts: 36
SetVisibleRowCount gets ignored. The list always displays all of its items, but I only want to display four at a time. This happens with all my lists. This piece of code is just one out of several cases.

Brian Cole
Author
Ranch Hand

Joined: Sep 20, 2005
Posts: 862
Originally posted by Marc Beck:
SetVisibleRowCount gets ignored. The list always displays all of its items, but I only want to display four at a time. This happens with all my lists. This piece of code is just one out of several cases.



So how do you actually display leaderlist on the screen?

Calling setVisibleRowCount() should affect the preferred size of the scroll pane, but many layout managers will ignore the preferred size. Other than that setVisibleRowCount() doesn't do a whole lot.

For grins you might want to call setLayoutOrientation(JList.VERTICAL_WRAP) just to see what effect it has.


bitguru blog
Marc Beck
Ranch Hand

Joined: Sep 09, 2006
Posts: 36
I am using box layout manager to display Leaderlist and all my other lists. I tried what you suggested, but it did not do anything.
 
jQuery in Action, 2nd edition
 
subject: SetVisibleRowCount ignored
 
Similar Threads
JSplitPane/JScrollPane/JList alignment
Difficulty getting a JScrollPane onto a JList box
setVisibleRowCount doesn't want to
JList (Scrollable?)
Regarding JList- Combobox Swing