aspose file tools*
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Setting to the default element" Watch "Setting to the default element" New topic
Author

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.

Cheers,
Rachel
 
wood burning stoves
 
subject: Setting to the default element