I think you need to work with a ListModel. Create a list model to add the
data to, then create the JList to display the list:
listmodel_1=new DefaultListModel();
jList1=new JList(listmodel_1);
you may be able to just get the list model from your already data-populated
JList, and set teh selected index on that. -Ike
"Tom" <> wrote in message
news:3f26fe72$0$7161$. be...
>
> 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
|