| java.sun.com > Guidelines Home Page > Java Look and Feel Design Guidelines > Part III: The Components of the Java Foundation Classes > 8: Dialog Boxes and Alert Boxes > Common Dialog Boxes |
The find, login, preferences, and progress dialog boxes are common in many applications. These dialog boxes are not supplied by the JFC. The following sections show simple versions of these dialog boxes that are consistent with the Java look and feel. You can adapt the designs for these dialog boxes to suit your needs.
A find dialog box is a multiple-use window that enables users to search for a specified text string. In most cases, you should make this dialog box modeless so users can perform multiple searches in succession. An example is shown in Figure 116.
Click here to view the corresponding code for Figure 116 (also available on the companion book's CD-ROM).
Figure 116 Sample Find Dialog Box
A login dialog box (shown in Figure 117) enables users to identify themselves and enter a password. Depending on where you use this single-use dialog box in your application, you can make it modal or modeless.
Click here to view the corresponding code for Figure 117 (also available on the book's companion CD-ROM).
Figure 117 Sample Login Dialog Box
For a discussion of effective interaction in login dialog boxes, see Design for Smooth Interaction.
A preferences dialog box (as shown in Figure 118) enables users to view and modify the characteristics of an application.
As a general rule, you should make this single-use dialog box modeless.
Click here to view the corresponding code for Figure 118 (also available on the book's companion CD-ROM).
Figure 118 Sample Preferences Dialog Box
If your preferences dialog box is very complex, you can simplify it by using a tabbed pane to organize the options, as shown in Figure 111.
A progress dialog box provides feedback for long operations and lets users know that the system is working on the previous command.
The progress dialog box in Figure 119 monitors the progress of a file copy operation. The dialog box includes the JFC progress bar, a command button that users can click to stop the process, and labels to further explain the progress of the operation. If users can perform other tasks while the operation is in progress, you should make a progress dialog box modeless.
Click here to view the corresponding code for Figure 119 (also available on the book's companion CD-ROM).
Figure 119 Sample Progress Dialog Box
Display a
progress dialog box (or supply a progress bar elsewhere in your
application) if an operation takes longer than 6 seconds.
If a
progress bar dialog box includes a button to stop the process, place it
after the progress bar. (In languages that read from left to right, the button
appears to the right of the progress bar.) If the state will remain as it was
before the process started, use a Cancel button. If the process might alter the
state as it progresses (for example, deleted records will not be restored), use
a Stop button. If stopping the process could lead to data loss, give users a
chance to confirm the Stop command by displaying a Warning alert box.
Close a
progress dialog box automatically when the operation is complete.
If delays
are a common occurrence in your application (for example, a web
browser), build a progress bar into the primary window so that you don't
have to keep displaying a progress dialog box.
Because
translation of the word "Stop" can result in words with subtly
different meanings, point out to your translators the specialized meaning of
the Stop button in a progress dialog box. Stop indicates that the process
might leave the system in an altered state, whereas Cancel means that no
change in the system state will occur.
| Java Look and Feel Design Guidelines, second edition.
Copyright 1994-2004 Sun Microsystems, Inc. All Rights Reserved. |