Overview | Package | Class | Tree | Deprecated | Index | Help Java Platform
1.1.7
PREV PACKAGE | NEXT PACKAGE FRAMES  | NO FRAMES

Package com.sun.java.swing

Interface Summary
Action The JFC Action interface provides a useful extension to the ActionListner interface in cases where the same functionality may be accessed by several controls.
BoundedRangeModel Defines the data model used by components like Sliders and ProgressBars.
ButtonModel State Model for Buttons
CellEditor  
ComboBoxEditor  
ComboBoxModel ComboBoxDataModel is a ListDataModel with a selected item This selected item is in the model since it is not always in the item list.
DesktopManager DesktopManager objects are owned by a JDesktopPane object.
Icon A small fixed size picture, typically used to decorate components.
JComboBox.KeySelectionManager The interface that defines a KeySelectionManager.
ListCellRenderer Identifies components that can be used as "rubber stamps" to paint the cells in a JList.
ListModel  
ListSelectionModel This interface represents the current state of the selection for any of the components that display a list of values with stable indices.
MenuElement Any component that can be placed into a menu should implement this interface.
Renderer Renderer interface
RootPaneContainer This interface is implemented by components that have a single JRootPane child: JDialog, JFrame, JWindow, JApplet, JInternalFrame.
Scrollable An interface that provides information to a scrolling container like JScrollPane.
ScrollPaneConstants  
SingleSelectionModel A model that supports at most one indexed selection.
SwingConstants A collection of constants generally used for positioning and orienting components on the screen.
UIDefaults.ActiveValue This class enables one to store an entry in the defaults table that's constructed each time it's looked up with one of the getXXX(key) methods.
UIDefaults.LazyValue This class enables one to store an entry in the defaults table that isn't constructed until the first time it's looked up with one of the getXXX(key) methods.
WindowConstants  
 

Class Summary
AbstractAction This class provides default implementations for the JFC Action interface.
AbstractButton.AccessibleAbstractButton Accessiblity support.
AbstractButton.ButtonChangeListener Extend ChangeListener to be serializable

Warning: serialized objects of this class will not be compatible with future swing releases.

AbstractButton Defines the common behaviors for the JButton, JToggleButton, JCheckbox, and the JRadioButton classes.
AbstractListModel The Abstract definition for the data model the provides a List with its contents.
BorderFactory Factory class for vending standard Border objects.
Box.AccessibleBox  
Box.Filler.AccessibleBoxFiller  
Box.Filler An implementation of a lightweight component that participates in layout but has no view.
Box A lightweight container that uses a BoxLayout object as its layout manager.
BoxLayout A layout manager that allows multiple components to be layed out either vertically or horizontally.
ButtonGroup This class is used to create a multiple-exclusion scope for a set of buttons.
CellRendererPane.AccessibleCellRendererPane  
CellRendererPane This class is inserted in between cell renderers and the components that use them.
ColorChooserPanel The is the abstract superclass for color choosers.
DebugGraphics Graphics subclass supporting graphics debugging.
DefaultBoundedRangeModel A generic implementation of BoundedRangeModel.
DefaultButtonModel The default implementation of a Button component's data model.
DefaultCellEditor.EditorDelegate  
DefaultCellEditor The default editor for table and tree cells.
DefaultDesktopManager This is an implementaion of the DesktopManager.
DefaultFocusManager  
DefaultListModel This class implements the java.util.
DefaultListSelectionModel Default data model for list selections.
DefaultSingleSelectionModel A generic implementation of SingleSelectionModel.
FocusManager  
GrayFilter An image filter that "disables" an image by turning it into a grayscale image, and brightening the pixels in the image.
ImageIcon An implementation of the Icon interface that paints Icons from Images.
JApplet.AccessibleJApplet  
JApplet An extended version of java.applet.
JButton.AccessibleJButton The class used to obtain the accessible role for this object.
JButton An implementation of a "push" button.
JCheckBox.AccessibleJCheckBox The class used to obtain the accessible role for this object.
JCheckBox An implementation of a CheckBox -- an item that can be selected or deselected, and which displays its state to the user.
JCheckBoxMenuItem.AccessibleJCheckBoxMenuItem The class used to obtain the accessible role for this object.
JCheckBoxMenuItem A menu item that can be selected or deselected.
JComboBox.AccessibleJComboBox.AccessibleJComboBoxList  
JComboBox.AccessibleJComboBox The class used to obtain the accessible role for this object.
JComboBox Swing's implementation of a ComboBox -- a combination of a text field and drop-down list that lets the user either type in a value or select it from a list that is displayed when the user asks for it.
JComponent.AccessibleJComponent Inner class of JComponent used to provide default support for accessibility.
JComponent The base class for the Swing components.
JDesktopPane.AccessibleJDesktopPane The class used to obtain the accessible role for this object.
JDesktopPane A container used to create a multiple-document interface or a virtual desktop.
JDialog.AccessibleJDialog The class used to obtain the AccessibleRole for this object.
JDialog The main class for creating a dialog window.
JEditorPane.AccessibleJEditorPane The class used to obtain the accessible role for this object.
JEditorPane A text pane to edit various kinds of content, such as html and rtf.
JFrame.AccessibleJFrame The class used to obtain the AccessibleRole for this object.
JFrame An extended version of java.awt.
JInternalFrame.AccessibleJInternalFrame The class used to obtain the accessible role for this object.
JInternalFrame.JDesktopIcon.AccessibleJDesktopIcon The class used to obtain the accessible role for this object.
JInternalFrame.JDesktopIcon This component represents an iconified version of a JInternalFrame.
JInternalFrame A lightweight object that provides many of the features of a native frame, including dragging, closing, becoming an icon, resizing, title display, and support for a menu bar.
JLabel.AccessibleJLabel The class used to obtain the accessible role for this object.
JLabel A display area for a short text string or an image, or both.
JLayeredPane.AccessibleJLayeredPane The class used to obtain the accessible role for this object.
JLayeredPane JLayeredPane adds depth to a JFC/Swing container, allowing components to overlap each other when needed.
JList.AccessibleJList.AccessibleJListChild  
JList.AccessibleJList The class used to obtain the accessible role for this object.
JList A component that allows the user to select one or more objects from a list.
JMenu.AccessibleJMenu The class used to obtain the accessible role for this object.
JMenu.WinListener A listener class that watches for a popup window closing.
JMenuBar.AccessibleJMenuBar The class used to obtain the accessible role for this object.
JMenuBar An implementation of a MenuBar.
JMenu An implementation of a menu -- a popup window containing JMenuItems that is displayed when the user selects an item on the JMenuBar.
JMenuItem.AccessibleJMenuItem The class used to obtain the accessible role for this object.
JMenuItem An implementation of a MenuItem.
JOptionPane JOptionPane makes it easy to pop up a standard dialog box that prompts users for a value or informs them of something.
JPanel.AccessibleJPanel The class used to obtain the accessible role for this object.
JPanel JPanel is a generic lightweight container.
JPasswordField.AccessibleJPasswordField The class used to obtain the accessible role for this object.
JPasswordField JPasswordField is a lightweight component that allows the editing of a single line of text where the view indicates something was typed, but does not show the original characters.
JPopupMenu.AccessibleJPopupMenu  
JPopupMenu.WindowPopup.AccessibleWindowPopup The class used to obtain the accessible role for this object.
JPopupMenu An implementation of a Popup Menu -- a small window which pops up and displays a series of choices.
JProgressBar.AccessibleJProgressBar The class used to obtain the accessible role for this object.
JProgressBar.ModelListener  
JProgressBar A component that displays an integer value graphically within a bounded interval.
JRadioButton.AccessibleJRadioButton The class used to obtain the accessible role for this object.
JRadioButton An implementation of a radio button -- an item that can be selected or deselected, and which displays its state to the user.
JRadioButtonMenuItem.AccessibleJRadioButtonMenuItem The class used to obtain the accessible role for this object.
JRadioButtonMenuItem An implementation of a RadioButtonMenuItem.
JRootPane.AccessibleJRootPane The class used to obtain the accessible role for this object.
JRootPane.RootLayout A custom layout manager that is responsible for the layout of layeredPane, glassPane, and menuBar.
JRootPane The fundamental component in the container hierarchy.
JScrollBar.AccessibleJScrollBar The class used to obtain the accessible role for this object.
JScrollBar An implementation of a scrollbar.
JScrollPane.AccessibleJScrollPane The class used to obtain the accessible role for this object.
JScrollPane.ScrollBar By default JScrollPane creates scrollbars that are instances of this class.
JScrollPane A specialized container that manages a viewport, optional vertical and horizontal scrollbars, and optional row and column heading viewports.
JSeparator.AccessibleJSeparator The class used to obtain the accessible role for this object.
JSeparator An implementation of a Menu Separator -- a divider between menu items that breaks them up into logical groupings.
JSlider.AccessibleJSlider The class used to obtain the accessible role for this object.
JSlider A component that lets the user graphically select a value by slding a knob within a bounded interval.
JSplitPane.AccessibleJSplitPane The class used to obtain the accessible role for this object.
JSplitPane JSplitPane is used to divide two (and only two) Components.
JTabbedPane.AccessibleJTabbedPane The class used to obtain the accessible role for this object.
JTabbedPane.ModelListener We pass ModelChanged events along to the listeners with the tabbedpane (instead of the model itself) as the event source.
JTabbedPane A component which lets the user switch between a group of components by clicking on a tab with a given title and/or icon.
JTable.AccessibleJTable.AccessibleJTableCell The class used to obtain the AccessibleRole for a cell.
JTable.AccessibleJTable The class used to obtain the accessible role for this object.
JTable JTable is a user-interface component that presents data in a two-dimensional table format.
JTextArea.AccessibleJTextArea The class used to obtain the accessible role for this object.
JTextArea A TextArea is a multi-line area that displays plain text.
JTextField.AccessibleJTextField The class used to obtain the accessible role for this object.
JTextField JTextField is a lightweight component that allows the editing of a single line of text.
JTextPane A text component that can be marked up with attributes that are represented graphically.
JToggleButton.AccessibleJToggleButton The class used to obtain the accessible role for this object.
JToggleButton.ToggleButtonModel The ToggleButton model

Warning: serialized objects of this class will not be compatible with future swing releases.

JToggleButton An implementation of a two-state button.
JToolBar.AccessibleJToolBar The class used to obtain the accessible role for this object.
JToolBar.Separator A toolbar-specific separator.
JToolBar JToolBar provides a component which is useful for displaying commonly used Actions or controls.
JToolTip.AccessibleJToolTip The class used to obtain the accessible role for this object.
JToolTip Used to display a "Tip" for a Component.
JTree.AccessibleJTree.AccessibleJTreeNode  
JTree.AccessibleJTree The class used to obtain the accessible role for this object.
JTree.DynamicUtilTreeNode DynamicUtilTreeNode can wrap vectors/hashtables/arrays/strings and create the appropriate children tree nodes as necessary.
JTree.EmptySelectionModel EmptySelectionModel is a TreeSelectionModel that does not allow anything to be selected.
JTree.TreeSelectionRedirector Handles creating a new TreeSelectionEvent with the JTree as the source and passing it off to all the listeners.
JTree A control that displays a set of hierarchical data as an outline.
JViewport.AccessibleJViewport The class used to obtain the accessible role for this object.
JViewport.ViewListener A listener for the view.
JViewport The "viewport" or "porthole" through which you see the underlying information.
JWindow.AccessibleJWindow The class used to obtain the AccessibleRole for this object.
JWindow A JWindow is a container that can be displayed anywhere on the user's desktop.
KeyStroke A KeyStroke instance represents a key being typed on the keyboard -- it contains both a char code for the key and a modifier (alt, shift, ctrl, meta, or a combination).
LookAndFeel Completely characterizes a look and feel from the point of view of the pluggable look and feel components.
MenuSelectionManager  
OverlayLayout A layout manager to arrange components over the top of each other.
ProgressMonitor A class to monitor the progress of some operation.
ProgressMonitorInputStream Monitors the progress of reading from some InputStream.
RepaintManager  
ScrollPaneLayout The layout manager used by JScrollPane.
SizeRequirements For the convenience of layout managers, calculates information about the size and position of components.
SwingUtilities A collection of utility methods for Swing.
SyntheticImage A helper class to make computing synthetic images a little easier.
Timer Object subclass that causes an action to occur at a predefined rate.
ToolTipManager.insideTimerAction  
ToolTipManager.outsideTimerAction  
ToolTipManager.stillInsideTimerAction  
ToolTipManager Manages all the ToolTips in the system.
UIDefaults A table of defaults for Swing components.
UIManager.LookAndFeelInfo Provide a little information about an installed LookAndFeel for the sake of configuring a menu or for initial application set up.
UIManager This class keeps track of the current look and feel and its defaults.
ViewportLayout The default layout manager for JViewport.
 

Exception Summary
UnsupportedLookAndFeelException An exception that indicates the request look & feel management classes are not present on the user's system.
 

Description

Provides a set of "lightweight" (all-JavaTM language) components that, to the maximum degree possible, work the same on all platforms. The Swing architecture provides a number of advantages in the areas of:

Wide Variety of Components

In general, the class names that start with "J" are the components you add to an application. Examples: JButton, JLabel, JList, JPanel, JTable, JTree. The remaining files in the swing package contain the utility classes and interfaces that the components use to function.

Pluggable Look and Feel

Instead of being restricted to a single "look and feel", you can select a look and feel and "plug it in". An interface made of Swing components can look like a Win32 app, a Motif app, or a Mac app. It can use the new "Metal" look and feel. Developers can use standard Swing components and design their own look and feel (L&F) for them, and even allow users to select the look and feel they prefer. The plaf package includes the standard "Pluggable Look And Feel" classes.

MVC Architecture

The Model-View-Controller (MVC) architecture is used consistently throughout the Swing component set. The View and Controller parts of the architecture are combined in the component. Each component has an associated Model class and an interface it uses. You can provide your own data-model for a component by subclassing the Model class or by implementing the appropriate interface. For example, you could subclass DefaultListModel or implement the ListModel interface, and then use the JList setModel method to attach your data-model to the component.

Keystroke Handling

The JComponent architecture makes it easy to handle keyboard events in nested components. You register interest in a particular combination of keystrokes by creating a KeyStroke object and registering it with the component. When you register the keystroke combination and its associated action, you also specify one of the following conditions to determine when the action is initiated:

Action Objects

Action-interface objects provide a single point of control for program actions. For example, a toolbar icon and a menu item can reference the same Action object. When the Action object is disabled, the GUI items that reference it are automatically disabled. The Action interface extends ActionListener, specifying an enabled property as well as properties for text-descriptions and graphic icons.

Nested Containers

As the keystroke handling shows, Swing was designed to manage nested containers gracefully. The main "heavyweight" containers (JWindow, JFrame, JDialog, and JApplet) as well as the major "lightweight" containers (JInternalFrame and JComponent) all delegate their operations to a JRootPane. This commonality produces a high degree of regularity in container nesting. In particular, since the fundamental component class (JComponent) contains a JRootPane, virtually any component can be nested within another. It means, for example, that a graphic can be nested in a list, and a combo box can be nested in a toolbar. The JRootPane class uses a JLayeredPane to manage a content pane and an optional menu bar in a way that is virtually transparent to the developer. It also provides for a glass pane -- a single pane that can overlap multiple containers and be used for drawing or to intercept mouse actions.

Virtual Desktops

The JDesktopPane and JInternalFrame classes can be used to create a virtual desktop, or "multiple document interface". A JInternalFrame can be specified as iconizable, exandable, or closable, while the JDesktopPane provides real estate for them to operate in.

Compound Borders

Insets (the space between the edges of the component and the area it is drawn in) can be specified with a blank border. In addition, many border styles are available, which can be combined to create compound borders.

Customized Dialogs

The JOptionPane class provides a variety of static methods that you can invoke to create and display both message dialogs and user-choice dialogs in a variety of formats. The "message" displayed in the dialog can be a string, a string-generating object, or an arbitrary component. You can also replace the choice-buttons with components you specify for user-selections.

For example, the following line creates a simple message dialog that requires the user's confirmation:

JOptionPane.showMessageDialog(null, "The file will be deleted.");

Additional options for customized dialogs are described in the JOptionPane class.

Standard Dialog Classes

Standard dialogs currently available include:

And more standard dialogs are on the way.

Structured Table and Tree Components

The JTable class provides a data-aware matrix. JTree provides hierarchical-structuring of data elements.

Powerful Text Manipulations

In addition to single-font text fields and text areas, Swing provides a JPassword field for hidden input and a JTextPane class for displaying multi-font text. In addition, the JEditorPane class provides editing capabilities for multi-font text, while the text.html and text.rtf packages handle text encoded in HyperText Markup Language (HTML) or Rich Text Format (RTF).

Generic Undo Capabilities

The undo package provides generic undo capabilities that can be used in a variety of situations.

Accessibility Support

Swing has built-in support for developers to make products that are compatible with Assistive Technologies (for alternative interfaces like, for example, braille.) All of the Swing components implement interface Accessible.

Package Specification

Related Documentation

For overviews, tutorials, examples, guides, and other documentation, please see:


Overview | Package | Class | Tree | Deprecated | Index | Help Java Platform
1.1.7
PREV PACKAGE | NEXT PACKAGE FRAMES  | NO FRAMES

Submit a bug or feature
Submit comments/suggestions about javadoc
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.