remove an Item from a JList
I抦 working now with the new jdk1.5.0 and I don抰 see any way to remove an Item from a JList with the methods shown in that class. I will try to illustrate what I want with an example:
copyJList =new JList();
add(new JScrollPane( copyJList ) );
colorJList =new JList( colorNames );// holds names of all colors
add(new JScrollPane( colorJList ) );// add list with scrollpane
copyJButton =new JButton("Copy >>>" );// create copy button
copyJButton.addActionListener(
new ActionListener()// anonymous inner class
{
// handle button event
publicvoid actionPerformed( ActionEvent event )
{
// place selected values in copyJList
copyJList.setListData( colorJList.getSelectedValues() );
[b]// delete selected values from colorJList
colorJList.remove( copyJList.getSelectedIndex() );[/b]
}// end method actionPerformed
}// end anonymous inner class
);// end call to addActionListener[code]
[/code]

