Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JList

 
zoe goddard
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sure I've seen a way to make sure that a selected item becomes visible in a JList. I can't seem to find it. Anyone remember what it is called.
I have
list.setSelectedIndex(0);
// Now I want to make sure it is in visible portion of the
// list.
Thanks for any help.
 
Angela Lamb
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think list.ensureIndexIsVisible(int index) is what you're looking for.
 
zoe goddard
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that's what I'm looking for. Thanks, I'll give it a try
 
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!