wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Need help in JComboBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Need help in JComboBox" Watch "Need help in JComboBox" New topic
Author

Need help in JComboBox

Akalya Baskaran
Greenhorn

Joined: Nov 15, 2012
Posts: 7
Hi,

PLease help me in creating a ComboBox with textfield and dropdown list goes like this: When i type a text in the textfield and press "Enter" key,the typed text should be added to the dropdown.
Also the dropdown list should contain all the values entered in the previous page.


Kemal Sokolovic
Bartender

Joined: Jun 19, 2010
Posts: 825
    
    5

If I understood you well, you would attach ActionListener to your JTextField component. The event would be triggered when you enter text and press the Enter key. So accordingly, your actionPerformed(ActionEvent event) method would contain the code to get the text from the field and add it to JComboBox (and probably then clear the text field).

Did you try to implement anything so far? Nobody's going to provide a complete solution for you... Try to follow the directions above and if you have any more doubts feel free to ask again with the code you get.


The quieter you are, the more you are able to hear.
Akalya Baskaran
Greenhorn

Joined: Nov 15, 2012
Posts: 7
I didnt try anything still.I will write the code in actionPerformed() method and will let you know.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help in JComboBox
 
Similar Threads
freaky IE form
Field Refresh Using AJAX in Struts2
Dynamic chnage on List from chnage on DropDown(ComboBox)
Sun Java Studio Creator : dropdown value ..
Combobox question.