Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Dialog Box Input Loop

Indicating end of input with cancel or close box, a special value, or empty input

Tutorial Details:

When reading input in a loop user must have some way of indicating that the end of the input has been reached.

Sentinal value. One way to indicate the end of the input is for the user to enter a special value to indicate that the end has been reached. This generally works, but does eliminate a possible value from the input. This may not be a problem in many cases, but it can be. A common special value is just the empty string.

Special signal - null. A better way to indicate the end of the input is often to do something special. For dialog box input, this could be clicking the close box or hitting the Cancel button. This is easy to test because a null value is returned in those cases.


 

Rate Tutorial:
http://www.roseindia.net/java/java-tips/examples-introductory/dialog/dialog-input-loop.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Dialog Box Input Loop

View Tutorial:
Dialog Box Input Loop

Related Tutorials:

Java gets serial support with the new javax.comm package - JavaWorld - May 1998
Java gets serial support with the new javax.comm package - JavaWorld - May 1998
 
Programming Java threads in the real world, Part 5 - JavaWorld - February 1999
Programming Java threads in the real world, Part 5 - JavaWorld - February 1999
 
Java Tip 72: Press Escape to close your Swing dialog windows
Java Tip 72: Press Escape to close your Swing dialog windows
 
Java gets serial support with the new javax.comm package
Java gets serial support with the new javax.comm package
 
Java Tip 85: Fun and games with JFileChooser - JavaWorld
Java Tip 85: Fun and games with JFileChooser - JavaWorld
 
Process XML with JavaBeans, Part 3 - JavaWorld January 2000
Process XML with JavaBeans, Part 3 - JavaWorld January 2000
 
Add a file finder accessory to JFileChooser - JavaWorld
Add a file finder accessory to JFileChooser - JavaWorld
 
Make room for JavaSpaces, Part 6 - JavaWorld October 2000
Make room for JavaSpaces, Part 6 - JavaWorld October 2000
 
Printing in Java, Part 2 - JavaWorld December 2000
Printing in Java, Part 2 - JavaWorld December 2000
 
Printing in Java, Part 3 - JavaWorld January 2001
Printing in Java, Part 3 - JavaWorld January 2001
 
Printing in Java, Part 4 - JavaWorld February 2001
Printing in Java, Part 4 - JavaWorld February 2001
 
Java security evolution and concepts, Part 5
Java security evolution and concepts, Part 5
 
Take command of your software
Take command of your software
 
Big designs for small devices
Big designs for small devices
 
Use select for high-speed networking
Use select for high-speed networking
 
Very interesting article
Very interesting article
 
Interesting ...
Interesting ...
 
Nice widget
Nice widget
 
Very interesting
Very interesting
 
Creating Wizard Dialogs with Java Swing
Wizard dialogs are ubiquitous in today's desktop applications. This article creates a framework for a simple wizard dialog, complete with Back, Next, and Cancel buttons that you can extend for use in your applications as necessary.
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.