PDA

Click to See Complete Forum and Search --> : Java - Add items to a listbox from a textbox


Giftx
Apr 28th, 2008, 03:07 PM
Hi everybody,
please can someone show me a simple code to transfer data entered into a textbox to a listbox.

I have a GUI which contains a Listbox, a textbox and a command button.
My objective is to enter some data in the textbox, press the command button(ENTER) and the data is transfered to the listbox.

Any input will be greatly appreciated.
GiftX.

ComputerJy
Apr 29th, 2008, 12:30 AM
selectedDomains.addElement(jTextFieldDomain.getText());
jListDomain.setListData(selectedDomains);
where selectedDomains is a Vector