Chapter Summary


[Page 650 (continued)]

Technical Terms

adapter class

callback design

content pane

containment hierarchy

controller

event model

inner class

layout manager

lightweight component

listener

model

model-view-controller (MVC)

peer model

pluggable look and feel

view

widget hierarchy

Summary of Important Points

  • Java provides two sets of Graphical User Interface (GUI) components, the Abstract Windowing Toolkit (AWT), which was part of Java 1.0, and the Swing component set, the GUI part of the Java Foundation Classes (JFC), introduced in JDK 1.1.


  • [Page 651]
  • Unlike their AWT counterparts, Swing components are written entirely in Java. This allows programs written in Swing to have a platform-independent look and feel. There are three built-in look-and-feel packages in Swing: a Windows style, a Unix-like Motif style, and a purely Java Metal style.

  • Swing components are based on the model-view-controller (MVC) architecture, in which the component is divided into three separate objects: how it looks (view), what state it's in (model), and what it does (controller). The view and controller parts are sometimes combined into a single user interface class, which can be changed to create a customized look and feel.

  • AWT components are based on the peer model, in which every AWT component has a peer in the native windowing system. This model is less efficient and more platform dependent than the MVC model.

  • Java's event model is based on event listeners. When a GUI component is created, it is registered with an appropriate event listener, which takes responsibility for handling the component's events.

  • A user interface combines four functions: guidance/information for the user, input, output, and control.

  • Components in a GUI are organized into a containment hierarchy rooted at the top-level window. JPanels and other Containers can be used to organize the components into a hierarchy according to function or some other criterion.

  • The top-level Swing classesJApplet, JDialog, JFrame, and JWindowuse a content pane as their component container.

  • A GUI should minimize the number of input devices the user needs to manipulate, as well as the complexity the user needs to deal with. Certain forms of redundancysuch as two independent but complete sets of controlsare desirable because they make the interface more flexible and more widely applicable.

  • A layout manager is an object that manages the size and arrangement of the components in a container. The AWT and Swing provide a number of built-in layouts, including flow, border, grid, and box layouts.

  • A radio button is a toggle button that belongs to a group in which only one button from the group may be selected at the same time. A checkbox is a toggle button that always displays its state.

  • A well-designed interface should reduce the chance of user error and should make it as easy as possible to recover from errors when they occur.




Java, Java, Java(c) Object-Orienting Problem Solving
Java, Java, Java, Object-Oriented Problem Solving (3rd Edition)
ISBN: 0131474340
EAN: 2147483647
Year: 2005
Pages: 275

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net