my dog learned polymorphism
The moose likes Swing / AWT / SWT and the fly likes Setting to the default element Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Setting to the default element" Watch "Setting to the default element" New topic

Setting to the default element

Pradeep Kadambar
Ranch Hand

Joined: Oct 18, 2004
Posts: 148
If the user enters a emty string then set the combo selection to the string that was previously selected.

Please give a way out of this problem.
Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
You can test the length of the string or see if the string is all space characters, or use trim to remove white space and then test the length. If the string is in one of these conditions, then don't add it to the box.

I agree. Here's the link:
subject: Setting to the default element
It's not a secret anymore!