Results 1 to 7 of 7
- 08-19-2010, 01:22 PM #1
Member
- Join Date
- Jul 2010
- Posts
- 32
- Rep Power
- 0
Transfering all items from one List to another
List queryResltList = new List();
List actionListList= new List();
//i can transfer one item :
//transfering from queryResltList to actionListList.
but now i want all items to be moved from one List to another by clicking the button.
if (e.getSource()==buttonname)
{
queryResltList.add(actionListList.getSelectedItem( ));
actionListList.remove(actionListList.getSelectedIn dex());
}
else if(e.getSource==buttonname)
{
// i need help here to transfer all items without selection.
}Last edited by Bulelakes; 08-19-2010 at 02:58 PM. Reason: i used wrong statement
- 08-21-2010, 06:33 PM #2
not really database related,
Java Code:queryResltList.addAll(actionListList); actionListList.clear();
- 08-21-2010, 06:50 PM #3
- 08-22-2010, 02:26 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Move the thread to the correct place. :)
- 08-23-2010, 08:32 AM #5
Member
- Join Date
- Jul 2010
- Posts
- 32
- Rep Power
- 0
The addAll method is not supported by netbeans so it doesn't work still!!
- 08-23-2010, 08:40 AM #6
Member
- Join Date
- Jul 2010
- Posts
- 32
- Rep Power
- 0
Thank u so much for trying to help me finally i got it right below is my code
Java Code:if (e.getSource()==cpyallrytBtn) { int i =queryResltList.getSelectedIndex(); String items[]; while(i==-1) { items =(String[]) queryResltList.getItems(); for(int j=0;j<items.length;j++){ actionListList.add(items[j]); queryResltList.removeAll(); } break; }
- 08-23-2010, 08:48 AM #7
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Transfering Focus
By kevh in forum AWT / SwingReplies: 0Last Post: 07-30-2010, 06:12 PM -
List of Items in JTextArea
By ŖàΫ ỏƒ Ңόρę in forum New To JavaReplies: 7Last Post: 03-15-2010, 09:03 PM -
Transfering files over Bluetooth (with javax.bluetooth)
By weber10 in forum CLDC and MIDPReplies: 0Last Post: 02-26-2009, 08:14 PM -
How to display a list of items and on click display subitems?
By mandyj in forum New To JavaReplies: 8Last Post: 12-29-2008, 07:12 AM -
Transfering files over HTTP
By DannyZB in forum NetworkingReplies: 16Last Post: 11-09-2008, 09:50 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks