tags:

views:

136

answers:

1

I have a JList which is populated after importing a file. Is it possible to have the first item/element of the JList highlighted/selected. I have browsed many places hoping to find a line along the lines of

list.setFocus(0);
//or
listSelectionEvent.setSelection(0);
//0 referring to index point of the list

Maybe this isn't even possible... ?

A: 

Use:

    list.setSelectedIndex(0);
Mark Byers