This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JComboBox - Set the selection programatically at runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "JComboBox - Set the selection programatically at runtime" Watch "JComboBox - Set the selection programatically at runtime" New topic
Author

JComboBox - Set the selection programatically at runtime

Pradeep Kadambar
Ranch Hand

Joined: Oct 18, 2004
Posts: 148
I am using an Editable JComboBox containing predefined entries. If the user types in a new entry add it. If it is empty then show a warning that it cannot be empty and set it to the previous selected string.

I tried this in ActionListner. Every time the comboChanged event is triggered I check for emty string if not then store the selectedItem as oldString. So on comboEdited I write



Please suggest a solution :roll:
Don Kiddick
Ranch Hand

Joined: Dec 12, 2002
Posts: 580
What's the problem ?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: JComboBox - Set the selection programatically at runtime
 
Similar Threads
JComboBox
Interesting exception errors
please help....
having trouble understanding generics
Jtable combo box issue