Java Sun >
Guidelines Home Page >  Java Look and Feel Design Guidelines
Part I: Overview
2: The Java Foundation Classes
User Interface Components of the JFC
  Previous Next Contents/Index/Search

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


Component Structure

Pluggable Look and Feel Architecture

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).

Example Model and Interfaces

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


Pluggable Look and Feel

Client Properties

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.

Major JFC User Interface Components

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.


Component Code Name Common Name For Details
JApplet JApplet Applet click here
JButton JButton Command button and toolbar button click here and here
JCheckBox JCheckBox Checkbox click here
JCheckBoxMenuItem JCheckBoxMenuItem Checkbox menu item click here
JColorChooser JColorChooser Color chooser click here
JComboBox JComboBox Noneditable and editable combo boxes click here
JDesktopPane JDesktopPane Backing window click here
JDialog JDialog Dialog box, secondary window, and utility window click here, here, and here
JEditorPane JEditorPane Editor pane click here
JFrame JFrame Primary window click here
JInternalFrame JInternalFrame Internal window, minimized internal window, and internal utility window click here and here
JLabel JLabel Label click here and here
JList JList List components (list boxes and selectable lists) click here and here
JMenu JMenu Drop-down menu and submenu click here
JMenuBar JMenuBar Menu bar click here
JMenuItem JMenuItem Menu item click here
JOptionPane JOptionPane Alert box click here
JPanel JPanel Panel click here
JPasswordField JPasswordField Password field click here
JPopupMenu JPopupMenu Contextual menu click here
JProgressBar JProgressBar Progress bar click here
JRadioButton JRadioButton Radio button click here
JRadioButtonMenuItem JRadioButtonMenuItem Radio button menu item click here
JScrollBar JScrollBar Scrollbar click here
JScrollPane JScrollPane Scroll pane click here
JSeparator JSeparator Separator click here
JSlider JSlider Slider click here
JSplitPane JSplitPane Split pane click here
JTabbedPane JTabbedPane Tabbed pane click here
JTable JTable Table click here
JTextArea JTextArea Plain text area click here
JTextField JTextField Noneditable and editable text fields (single line) click here
JTextPane JTextPane Editor pane with the styled editor kit plug-in click here
JToggleButton JToggleButton Toggle button and toolbar toggle button click here and here
JToolBar JToolBar Toolbar click here
JToolTip JToolTip Tool tip click here
JTree JTree Tree component click here
JWindow 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.
Previous Next Contents/Index/Search
Table 1   Names of the JFC User Interface Components 
Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
Java 8 banner (182)