• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JComboBox - Set the selection programatically at runtime

 
Pradeep Kadambar
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the problem ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic