A
Abs
Hi!
I'm using the "setSelectedValue" method from the JList class to
select an item from a list of objects extending a class I developed
named "Transition". This is the code I cannot get to work:
DefaultListModel model=new DefaultListModel();
JList list=new JList(model);
model.addElement(new DefaultTransition());
model.addElement(new FadeTransition());
Transition transition=getTransition();
list.setSelectedValue(transition,true);
I supposed the "setSelectedValue" method would select one of the two
items in the list but nothing gets selected. What am I doing wrong ?
Thanks in advance
I'm using the "setSelectedValue" method from the JList class to
select an item from a list of objects extending a class I developed
named "Transition". This is the code I cannot get to work:
DefaultListModel model=new DefaultListModel();
JList list=new JList(model);
model.addElement(new DefaultTransition());
model.addElement(new FadeTransition());
Transition transition=getTransition();
list.setSelectedValue(transition,true);
I supposed the "setSelectedValue" method would select one of the two
items in the list but nothing gets selected. What am I doing wrong ?
Thanks in advance