Re: JList: Scroll to Selected Item
- From: Knute Johnson <nospam@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 26 Jan 2008 15:31:50 -0800
Hal Vaughan wrote:
I'm using Java 1.4.2 and I've tried searching for this and can't find it,
but I'm sure I saw a method for a JList to scroll to the selected item.
There are times a JList (in a JScrollPane) is reloaded. On some platforms,
apparently, when I reload it, even though I make sure the same item stays
selected, users report that the list then resets to show the top of the
list only.
Maybe I'm mixing things up, but I was sure I saw something like
scrollToSelected() for a JList or JScrollPane, but I can't find it in the
API index and couldn't find it in a search. Is it under a different
wording or is there another method that scrolls a JList to show the
selected item?
Thanks!
Hal
See JList.ensureIndexIsVisible() and JList.setSelectedValue()
--
Knute Johnson
email s/nospam/knute/
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDem
.
- Follow-Ups:
- Re: JList: Scroll to Selected Item
- From: Hal Vaughan
- Re: JList: Scroll to Selected Item
- References:
- JList: Scroll to Selected Item
- From: Hal Vaughan
- JList: Scroll to Selected Item
- Prev by Date: JList: Scroll to Selected Item
- Next by Date: Re: JList: Scroll to Selected Item
- Previous by thread: JList: Scroll to Selected Item
- Next by thread: Re: JList: Scroll to Selected Item
- Index(es):
Relevant Pages
|