| java.sun.com > Guidelines Home Page > Java Look and Feel Design Guidelines > Part I: Overview > 2: The Java Foundation Classes > User Interface Components of the JFC |
The JFC includes Swing, a complete set of user interface components, including windows, dialog boxes, alert boxes, panels and panes, and basic controls. Each JFC component contains a model (the data structure) and a user interface (the presentation and behavior of the component), as shown in the following illustration.
Figure 14 Structure of the JFC Components
Because both presentation and behavior are separate and replaceable ("pluggable"), you can specify any of several look and feel designs for your application--or you can create your own look and feel. The separation of a component's model (data structure) from its user interface (display and interaction behavior) is the empowering principle behind the pluggable look and feel architecture of the JFC. A single JFC application can present a Java look and feel, a platform-specific look and feel, or a customized interface (for example, an audio interface).
Consider the slider and the editable text field in the following figure as an example. The underlying model contains information about the current value as well as the minimum and maximum values. The slider's interface determines how users see or interact with the slider. The slider enforces the idea of a range of choices. However, an editable text field would be easier for keyboard users. The editable text field shares the data model with the slider. The text field's interface contains data about the position and color of the label and the text field and the response when users type in a new value.
Figure 15 Pluggable Look and Feel Architecture of a Slider
You can use the client properties mechanism to display an alternate form of a specific Java user interface component. If a look and feel design does not support a property, it ignores the property and displays the component as usual. You can set alternate appearances for sliders, toolbars, trees, and internal windows. For instance, a nonfilling slider might be displayed by default. However, by using the client properties mechanism, you can display a filling slider, as shown in the preceding figure.
The following table illustrates (with icons
intended for use in a GUI builder) the major user interface components in the JFC. Components are listed alphabetically by
their names in code. Their English names are provided, followed by the location of more detailed information on each
component.
![]()
JApplet
Applet
click here
JButton
Command button and toolbar button
click here and here
JCheckBox
Checkbox
click here
JCheckBoxMenuItem
Checkbox menu item
click here
JColorChooser
Color chooser
click
here
JComboBox
Noneditable and editable combo boxes
click
here
JDesktopPane
Backing window
click here
JDialog
Dialog box, secondary window, and utility window
click here, here, and here
JEditorPane
Editor pane
click here
JFrame
Primary window
click here
JInternalFrame
Internal window, minimized internal window, and internal utility window
click here and here
JLabel
Label
click here and here
JList
List components (list boxes and selectable lists)
click here and here
JMenu
Drop-down menu and submenu
click here
JMenuBar
Menu bar
click
here
JMenuItem
Menu item
click here
JOptionPane
Alert box
click here
JPanel
Panel
click here
JPasswordField
Password field
click here
JPopupMenu
Contextual menu
click here
JProgressBar
Progress bar
click
here
JRadioButton
Radio button
click
here
JRadioButtonMenuItem
Radio button menu item
click
here
JScrollBar
Scrollbar
click here
JScrollPane
Scroll pane
click here
JSeparator
Separator
click here
JSlider
Slider
click here
JSplitPane
Split pane
click here
JTabbedPane
Tabbed pane
click here
JTable
Table
click here
JTextArea
Plain text area
click here
JTextField
Noneditable and editable text fields (single line)
click here
JTextPane
Editor pane with the styled editor kit plug-in
click here
JToggleButton
Toggle button and toolbar toggle button
click here and here
JToolBar
Toolbar
click here
JToolTip
Tool tip
click here
JTree
Tree component
click here
JWindow
Plain (unadorned) window
click here
In the JFC, the typical primary windows that users work with are based on the
JFrame component. Unadorned windows that consist of a rectangular
region without any title bar, close control, or other window controls are
based on the JWindow component. Designers and developers typically use
the JWindow component to create windows without title bars, such as
splash screens.
For details on the use of windows, panels, and panes, see Chapter 7.
| Java Look and Feel Design Guidelines, second edition.
Copyright 2001. Sun Microsystems, Inc. All Rights Reserved. |