站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.4.1, Java 2 SDK 英文文档

Windows Look and Feel Update - JDK 5 Documentation v1.4.1, Java 2 SDK 英文文档

Windows Look and Feel Update

Overview

The ideal Swing application running under the Windows look and feel would be indistinguishable from its native running counterparts, however due to both changes in the native Windows look and feel (Windows 98, Windows 2000, etc.) and atrophy of our existing Windows look and feel implementation, this has not been the reality. However, for this release we have provided an updated Windows look and feel which integrates seamlessly into the Windows desktop.

This project was composed of a set of independent smaller projects, which involve either fixing a previous emulation deficiency or adding functionality to track 2000/98 features. In some cases the project spans both Swing and AWT:

We chose to modify and enhance the com.sun.java.swing.plaf.windows look and feel package rather than introduce a new 'window2000' package. Almost all of the new functionality is keyed off of Windows native user preferences so that an updated windows look and feel package gracefully runs on eitherWindows 95, Windows 98, Windows NT or Windows 2000 machines. In other words, if a running Swing application detects that a particular user preference (such as Menu fading) doesn't exist, then the windows look and feel will not execute that feature.

The focus of this project was quality, not quantity. Where we deemed it difficult to implement a feature with a high quality result, we deferred that feature to a future release when we can emulate it with better fidelity.

Fix Emulation Bugs

There were many bugs filed against our Windows look and feel and we fixed many of these with this release. We are tracking these bugs witha "w2k" keyword. See Windows Look And Feel Buglist for a list of these windows look and feel bugs.

Desktop Property Support

The current Windows look and feel in Swing only tracks the user's desktop colorscheme (via AWT's SystemColor mechanism). However, on the Windowsdesktop, the user can set many more GUI preferences, such as fonts, sounds, metrics, and can change them at any time and have Windows programs dynamically reflect those changes. We have revised Swing to honor a wider range of user preferences and to also support responding to dynamic changes made by the user. See Windows Desktop Properties Support Specification for details.

Column-Wrapping Lists

List was only capable of displaying a single column and has been updated to support wrapping into multiple columns (like the Windows Explorer pane). This feature is also used to better support the Windows filechooser. See JList Spec update for details.

Hot-Tracking Toolbar Buttons

Buttons contained inside toolbars have become flat in appearance and only when they are 'rolled over' do the borders appear. This feature is supported by the Metal look and feel, but will be added as a general Swing toolbar feature.

Gradient Titlebars

The titlebars on toplevel windows in Windows 2000 by default use a gradient pattern instead of a solid bar color. We get this for free on toplevel windows such as JFrame, however we will use Java2D to implement this rendering for JInternalFrame.

Scroll Wheel Support

Almost all PCs these days come with a scroll-wheel on the mouse and to support this AWT is adding support for scroll wheel input and Swing's scrolling components (JScrollPane, JScrollbar) are being modified to handle this new event type. See MouseWheel API for details of AWT support and see JScrollPane changes for details of support in Swing.

Keyboard Navigation Hiding

In windows the user can set a desktop property which causes applications to hide their keyboard navigation cues *until* ALT is pressed, at which time they magically appear. If the user has this option set on the desktop, Swing will implement this behavior in its menus. See Keyboard Navigation Spec for more information.

Menu/Tooltip Transition Effects

The most obvious feature addition to the Windows look and feel is the new stylistic menu animation. In Windows 98, menus can be set to appear by sliding out. Windows 2000 then introduced a very hip fade-in/fade-out for menus and tooltips.

In order to ensure the most accurate visual effect, this feature is implemented by forcing menus/tooltips to be true toplevel "heavyweight" windows which can take advantage of Microsoft Windows native window animation functionality inside the AWT.

File Chooser Makeover

Although Swing's JFileChooser component closely resembles the Windows file chooser, there are some deficiencies which limit its use on the Windows platform, such as the lack of support for network browsing and the Windows virtual desktop("My Computer", "My Network", etc.). See JFileChooser Spec update for more information.