Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SetVisibleRowCount ignored

 
Marc Beck
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 908
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Marc Beck
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic