This week's book giveaway is in the Java in General forum. We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line! See this thread for details.
JComboBox - Set the selection programatically at runtime
posted 11 years ago
I am using an EditableJComboBox 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