Java >
Guidelines Home Page >  Java Look and Feel Design Guidelines
Part III: The Components of the Java Foundation Classes
8: Dialog Boxes and Alert Boxes
  Previous Next Contents/Index/Search

8: Dialog Boxes and Alert Boxes 

A dialog box is a secondary window in which users perform a task that is supplemental to the task in the primary window. For example, a dialog box might enable users to set preferences or choose a file from the hard disk. A dialog box can contain panes and panels, text, graphics, controls (such as checkboxes, radio buttons, or sliders), and one or more command buttons. Dialog boxes use the native window frame of the platform on which they are running (in both non-MDI and MDI applications).

An alert box is a secondary window that provides for brief interaction with users. Alert boxes present error messages, warn of potentially harmful actions, obtain a small amount of information from users, or display messages. The basic alert box has a symbol that identifies the type of the alert, a textual message, and one or more command buttons. The layout of these components is determined by the JFC.

Figure 108   Dialog Box and Alert Box


Dialog Box and Alert Box

  If you are designing an MDI application, use the JFC-supplied dialog boxes and alert boxes. Because these secondary windows use the platform's native windows (and not the JFC-supplied internal window), they are free to move outside the backing window.

Modal and Modeless Dialog Boxes

Dialog boxes can be modal or modeless. A modal dialog box prevents users from interacting with the application until the dialog box is dismissed. However, users can move a modal dialog box and interact with other applications while the modal dialog box is open. This behavior is sometimes called "application-modal."

A modeless dialog box does not prevent users from interacting with the application they are in or with any other application. Users can go back and forth between a modeless dialog box and other application windows.

  Use modeless dialog boxes whenever possible. The order in which users perform tasks might vary, or users might want to check information in other windows before dismissing the dialog box. Users might also want to go back and forth between the dialog box and the primary window.

  Use modal dialog boxes when interaction with the application cannot proceed while the dialog box is displayed. For example, a progress dialog box that appears while your application is loading its data might be a modal dialog box if users can do nothing useful during the loading process.

Java Look and Feel Design Guidelines, second edition.
Copyright 1994-2004 Sun Microsystems, Inc. All Rights Reserved.
Previous Next Contents/Index/Search

Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
Java 8 banner (182)