The GUI Libraries
The second
java.awt
The
java.awt
package contains the older (Java 1.1) GUI component and support classes. Java GUI application development as of Java 1.2 has largely moved to the more powerful and versatile Swing classes; however, some Swing
java.awt.event
The
java.awt.event
package defines event classes and listeners. When a
javax.swing
The
javax.swing
package contains the Swing GUI component and support classes. Swing components are much more powerful and versatile than their AWT counterparts. For one thing, the Swing GUI containers have different panes or
The
javax.swing
package has a greatly expanded set of GUI components from which to choose. In the
java.awt
package there is only one class that represents a button and many of the style features, such as the component border, are hard-coded into the class. The
javax.swing
package defines many kinds of
javax.swing.borderWith Swing, you can be creative when it comes to assigning borders to your GUI components. The javax.swing.border class provides classes to generate raised, line, matte, etched, empty, titled, or compound borders. javax.swing.event
Swing GUI components are more diverse, versatile, and powerful than their AWT counterparts. It is only natural that they would need additional event classes to support their enhanced functionality. Among other things, the
javax.swing.event
package defines events and event listeners for
JTable
and
JTree
components, internal
javax.swing.tableOne of the powerful Swing components is the JTable class, defined in the javax.swing package, which allows you to represent data in a table-like format. The javax.swing.table package provides support classes and interfaces for JTable objects. Included are classes and interfaces to define the table and table column models, the table cell renderer, and the table cell editor. javax.swing.textThe javax.swing.text package provides classes and interfaces for working with editable and noneditable text components. Included is the Document interface that defines the document model for Swing text components. The classes defined in this package include the editor kit, view, highlighter, and document filter classes. javax.swing.treeAnother powerful Swing component is the JTree class that allows you to represent data in a tree-like structure. The javax.swing.tree package contains interfaces and classes that define the nodes, model, selection model, cell editor, and cell renderer of a JTree . |