I\'ve got a simple Jlist with data from List, Now I want to remove selected item from Jlist. Here is the code:
List
final DefaultListMo
According to the javadoc, using remove() instead of removeElementAt() is recommended, so :
remove()
removeElementAt()
public void actionPerformed(ActionEvent arg0) { int index = list.getSelectedIndex(); if (index != -1) { model.remove(index); }