【正文】
學(xué) 院: 專 業(yè): 指導(dǎo)教師: The Java 2 user interface Graphical and user interface capabilities have progressed in leaps and bounds since the early days of the Java language. The Java 2 platform contains a sophisticated crossplatform user interface architecture that consists of numerous highlevel ponents, an advanced featurerich deviceindependent graphics system, and a host of multimedia extensions. In this article, we39。ll explore this progression, examine the capabilities of the current version in detail, and finish by looking to the future to see what release will offer. Prior to the release of the Java 2 platform, the Abstract Window Toolkit (AWT) was the extent of the Java platform39。ll explore each of the major ponents of the JFC and then discuss some of the optional extensions. The heart of the JFC: Swing Swing, a GUI toolkit with a rich set of ponents, forms the heart of the JFC39。t make a window appear on UNIX without X System Window calls being involved. Enter Swing, which achieved this goal by making use of a subset of the AWT, including the basic drawing operations and the certain classes in the package: Container, Window, Panel, Dialog, and Frame. Best of all possible approaches Swing does not pletely follow the Java language as a platform route. Instead, it bines the best of both approaches by offering a bridge back to the native platforms. The mechanism for establishing this bridge is referred to as Pluggable LookandFeels (which is pretty close to the concept of themes, popular in the Linux munity). Each Swing ponent has a model of its functionality and a separate appearance (the lookandfeel), which can be set in advance or changed on the fly. Swing provides a Java lookandfeel (previously known as Metal), separate ones for the Windows and Motif platforms, and one for the Macintosh platform (as an extra option). The platform lookandfeels don39。s take a look at an example. Enabling the disabled: Accessibility The JFC Accessibility API equips Java applications so they can be accessed by users of all abilities, including people with sight, hearing, or dexterityrelated difficulties. These might include the inability to discern visible or auditory cues or to operate a pointing device. Two of the most important features of accessibility support are screen readers and magnifiers. Screen readers allow users to interact with a GUI by creating an offscreen representation of the interface and passing this to a speech synthesizer or a Braille terminal. Screen magnifiers provide an enlarged window of the screen, typically from 2 to 16 times the normal size. They generally keep track of pointer movements and changes in input focus and adjust the enlarged view accordingly. In addition, techniques such as font smoothing may be used to create a clearer picture. The Java Accessibility Bridge Some host systems, such as Microsoft Windows, provide their own accessibility features. By default, Java applications do not fully support them. For example, with native applications the screen magnifier detects when the input focus is switched to a different user interface ponent, such as by using the Tab key, and it adjusts the portion of the screen that is being magnified to show the ponent that now has the input focus. However, Swing applications use lightweight ponents, which are treated as images by the operating system, instead of discrete ponents. This means the screen magnifier cannot track changes in inp