On button click,move value from one list to another
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anjali_N
Posted On:   Monday, May 20, 2002 05:06 AM

I have a panel with two lists and two buttons "MOVE" and "UNDO". When a value is selected from the first list and "MOVE" is clicked I need to move the value into the second list. Can anyone help me in doing this. Any sample code will be useful.

Re: On button click,move value from one list to another

Posted By:   Mehdi_Naderi  
Posted On:   Monday, May 20, 2002 07:42 AM


public void actionPerformed(ActionEvent e) {
if ( e.getActionCommand().equals("MOVE") ) {
String[] si = list1.getSelectedIndexes();
for (int i = 0; i < si.length; i++) {
list2.add(si[i]);
list1.remove(si[i]);
}
}
}
About | Sitemap | Contact