Meaningless Drivel is fun!*
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
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Setting to the default element
 
Similar Threads
Tech Word Game
date format with MS Access database
ResultSet to Array
WA #1.....word association
How to convert byte array into string array?