Java TM Look and Feel Design Guidelines: Advanced Topics > Part II: Special Topics > 2: Windows > Setting the State of Windows and Objects   Previous Next Contents/Index/Search


Setting the State of Windows and Objects

A typical window or object has properties whose value can change--for example, its screen position and size. For each window or object, the set of current values for all its changeable characteristics is known as its state. Applications often need to initialize or restore the state of a window or object. This section provides guidelines related to the state of windows and objects.

Positioning Secondary Windows

When displaying a secondary window for the first time, applications should position that window in relation to its parent window, as shown in Figure 21.

Figure 21   Secondary Window Correctly Positioned in a Primary Window


In Figure 21, the secondary window is at the golden mean of the parent window--a point directly on the parent's vertical midline and slightly above its horizontal midline. A secondary window centered on its parent's golden mean is generally considered more visually pleasing than the same window centered on parent's exact center.

 When a secondary window opens for the first time, ensure that it is at the golden mean of its parent window. That is, ensure that the secondary window is both:

  • Centered on the vertical midline of its parent window
  • Positioned so that its center is n pixels below the top of the parent window

The value of n can be derived from the following equation, in which h is the height of the parent window:

 When closing and reopening a secondary window during a single application session, reopen that window where it was when it closed most recently. (Alert boxes are an exception. Always reopen an alert box at its initial position.)

Restoring the State of Property Windows

Users can change a property window's state by several means--for example, by rearranging the window's tabbed panes or other organizing elements.

 If a user reopens a property window after closing it during the same application session, restore that window's state. In other words, make the window look exactly as it did when the user last closed it--especially if the user has manipulated the window's components.

Java Look and Feel Design Guidelines: Advanced Topics.
Copyright 2001. 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
JavaOne Banner Java 8 banner (182)