See: Description
JColorChooser component.
JFileChooser component.
javax.swing.JTable.
javax.swing.JTree.
Action interface provides a useful extension to the
ActionListener interface in cases where the same functionality may be accessed by several controls.
Sliders and
ProgressBars.
KeySelectionManager.
ComboBoxModel.
getXXX(key) methods.
getXXX(key) methods.
Action interface.
CellEditors, providing default implementations for the methods in the
CellEditor interface except
getCellEditorValue().
List with its contents.
ActionMap provides mappings from
Objects (called
keys or
Action names) to
Actions.
Border objects.
ComponentInputMap is an
InputMap associated with a particular
JComponent.
Button component's data model.
DesktopManager.
java.util.Vector API, in that it implements the 1.1.x version of
java.util.Vector, has no collection class support, and notifies the
ListDataListeners when changes occur.
RowSorter that provides sorting and filtering around a grid-based data model.
DefaultRowSorter.ModelWrapper is responsible for providing the data that gets sorted by
DefaultRowSorter.
GroupLayout is a
LayoutManager that hierarchically groups components in order to position them in a
Container.
InputMap provides a binding between an input event (currently only
KeyStrokes are used) and an
Object.
java.applet.Applet that adds support for the JFC/Swing component architecture.
JColorChooser provides a pane of controls designed to allow a user to manipulate and select a color.
JFileChooser provides a simple mechanism for the user to choose a file.
JFormattedTextField extends
JTextField adding support for formatting arbitrary values, as well as retrieving a particular object once the user has edited the text.
AbstractFormatter are used by
JFormattedTextField to handle the conversion both from an Object to a String, and back from a String to an Object.
AbstractFormatterFactory are used by
JFormattedTextField to obtain instances of
AbstractFormatter which in turn are used to format values.
java.awt.Frame that adds support for the JFC/Swing component architecture.
JInternalFrame.
JLayer is a universal decorator for Swing components which enables you to implement various advanced painting effects as well as receive notifications of all
AWTEvents generated within its borders.
JLayeredPane adds depth to a JFC/Swing container, allowing components to overlap each other when needed.
TransferHandler.DropLocation representing a drop location for a
JList.
JMenuItems that is displayed when the user selects an item on the
JMenuBar.
JOptionPane makes it easy to pop up a standard dialog box that prompts users for a value or informs them of something.
JPanel is a generic lightweight container.
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.
JFrame,
JDialog,
JWindow,
JApplet, and
JInternalFrame.
JSeparator provides a general purpose component for implementing divider lines - most commonly used as a divider between menu items that breaks them up into logical groupings.
JSpinner whose model is a
SpinnerDateModel.
JFormattedTextField.
JSpinner whose model is a
SpinnerListModel.
JSpinner whose model is a
SpinnerNumberModel.
JSplitPane is used to divide two (and only two)
Components.
JTable is used to display and edit regular two-dimensional tables of cells.
TransferHandler.DropLocation representing a drop location for a
JTable.
JTextArea is a multi-line area that displays plain text.
JTextField is a lightweight component that allows the editing of a single line of text.
JToolBar provides a component that is useful for displaying commonly used
Actions or controls.
TransferHandler.DropLocation representing a drop location for a
JTree.
DynamicUtilTreeNode can wrap vectors/hashtables/arrays/strings and create the appropriate children tree nodes as necessary.
EmptySelectionModel is a
TreeSelectionModel that does not allow anything to be selected.
JWindow is a container that can be displayed anywhere on the user's desktop.
LayoutStyle provides information about how to position components.
LookAndFeel, as the name implies, encapsulates a look and feel.
Component to the user, typically on top of all the other
Components in a particular containment hierarchy.
PopupFactory, as the name implies, is used to obtain instances of
Popups.
RowFilter is used to filter out entries from the model so that they are not shown in the view.
Entry object is passed to instances of
RowFilter, allowing the filter to get the value of the entry's data, and thus to determine whether the entry should be shown.
RowSorter provides the basis for sorting and filtering.
JScrollPane.
ScrollPaneLayout.
SizeSequence object efficiently maintains an ordered list of sizes and corresponding positions.
SpinnerModel for sequences of
Dates.
SpinnerModel whose values are defined by an array or a
List.
SpinnerModel for sequences of numbers.
Spring class holds three properties that characterize its behavior: the
minimum,
preferred, and
maximum values.
SpringLayout lays out the children of its associated container according to a set of constraints.
Constraints object holds the constraints that govern the way a component's size and position change in a container controlled by a
SpringLayout.
ActionEvents at specified intervals.
ToolTips in the system.
Transferable to and from Swing components.
LazyInputMap will create a
InputMap in its
createValue method.
LazyValue which can be used to delay loading of the Class for the instance to be created.
UIManager manages the current look and feel, the set of available look and feels,
PropertyChangeListeners that are notified when the look and feel changes, look and feel defaults, and convenience methods for obtaining various default values.
LookAndFeel for the sake of configuring a menu or for initial application set up.
JViewport.
ParallelGroup can align its children.
JTables.
ComponentPlacement is an enumeration of the possible ways two components can be placed relative to each other.
RowFilters.
state bound property.
Provides a set of "lightweight" (all-Java language) components that, to the maximum degree possible, work the same on all platforms. For a programmer's guide to using these components, see Creating a GUI with JFC/Swing, a trail in The Java Tutorial. For other resources, see Related Documentation.
Typical Swing applications do processing in response to an event generated from a user gesture. For example, clicking on a JButton notifies all ActionListeners added to the JButton. As all events generated from a user gesture are dispatched on the event dispatching thread, most developers are not impacted by the restriction.
Where the impact lies, however, is in constructing and showing a Swing application. Calls to an application's main method, or methods in Applet, are not invoked on the event dispatching thread. As such, care must be taken to transfer control to the event dispatching thread when constructing and showing an application or applet. The preferred way to transfer control and begin working with Swing is to use invokeLater. The invokeLater method schedules a Runnable to be processed on the event dispatching thread. The following two examples work equally well for transferring control and starting up a Swing application:
public class MyApp implements Runnable {
public void run() {
// Invoked on the event dispatching thread.
// Construct and show GUI.
}
public static void main(String[] args) {
SwingUtilities.invokeLater(new MyApp(args));
}
}
Or:
public class MyApp {
MyApp(String[] args) {
// Invoked on the event dispatching thread. Do any initialization
// here.
}
public void show() {
// Show the UI.
}
public static void main(final String[] args) {
// Schedule a job for the event-dispatching thread:
// creating and showing this application's GUI.
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new MyApp(args).show();
}
});
}
}
This restriction also applies to models attached to Swing components. For example, if a
TableModel is attached to a
JTable, the
TableModel should only be modified on the event dispatching thread. If you modify the model on a separate thread you run the risk of exceptions and possible display corruption.
As all events are delivered on the event dispatching thread, care must be taken in event processing. In particular, a long running task, such as network io or computational intensive processing, executed on the event dispatching thread blocks the event dispatching thread from dispatching any other events. While the event dispatching thread is blocked the application is completely unresponsive to user input. Refer to SwingWorker for the preferred way to do such processing when working with Swing.
More information on this topic can be found in the Swing tutorial, in particular the section on Concurrency in Swing.
For overviews, tutorials, examples, guides, and other documentation, please see: