Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JList Problems

Reply
Thread Tools

JList Problems

 
 
Tom
Guest
Posts: n/a
 
      07-30-2003

Hi,

I have a JList with some String values in it and i have a ScrollPane tied
to the JList. Now the problem. When you have made a selection from the JList
i want to set my JList to the start value again but i cant get it to work.
I've tried with the JList methods: setSelectedIndex(int index), clearSelection(),
but nothing happends. So no i wonder how to set my JList to show the index
value i want?

Best Regards
Tom

 
Reply With Quote
 
 
 
 
Dave Roberts
Guest
Posts: n/a
 
      07-30-2003
Tom wrote:
> Hi,
>
> I have a JList with some String values in it and i have a ScrollPane tied
> to the JList. Now the problem. When you have made a selection from the JList
> i want to set my JList to the start value again but i cant get it to work.
> I've tried with the JList methods: setSelectedIndex(int index), clearSelection(),
> but nothing happends. So no i wonder how to set my JList to show the index
> value i want?
>
> Best Regards
> Tom
>


Try ensureIndexIsVisible(int index) to set the viewport such that a
particular item in the list is visible.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problems with JList nitesh sood Java 0 05-22-2008 12:35 PM
problems with JList nitesh sood Software 0 05-22-2008 09:22 AM
JList problem. Tom Java 1 07-30-2003 12:53 PM
JList question - how to fire a change event when nothing has changed? Sam Java 0 07-17-2003 10:40 PM
JList question Passero Java 1 06-28-2003 12:17 PM



Advertisments