What Is Swing

This section describes what is Java Swing - a JDK class package that implements a set of components for building graphical user interfaces (GUIs) and adding rich graphics functionality and interactivity to Java applications.

What Is Swing? Swing is a Java package, javax.swing, provided in J2SDK (Java 2 Software Development Kit). It provides many enhancements to the existing graphics package, AWT (Abstract Windows Toolkit) package, java.awt.

javax.swing and java.awt together offer a complete API (Application Programming Interface) for Java applications to operate graphical devices and create GUI (Graphical User Interfaces).

The JDK documentation offers another description of Swing: "The Swing classes (part of the Java Foundation Classes (JFC) software) implement a set of components for building graphical user interfaces (GUIs) and adding rich graphics functionality and interactivity to Java applications. The Swing components are implemented entirely in the Java programming language. The pluggable look and feel lets you create GUIs that can either look the same across platforms or can assume the look and feel of the current OS platform (such as Microsoft Windows, Solaris or Linux)."

The Swing package contains following subpackages:

Table of Contents

 About This Book

 JDK (Java Development Kit)

Introduction of Java Swing Package

What Is Swing

 SwingHello.java - My First Swing Program

 Graphics Environment of the Local System

 JFrame - Main Frame Class

 JLabel - Swing Label Class

 JButton - Swing Button Class

 JCheckBox - Swing Check Box Class

 JRadioButton - Swing Radio Button Class

 JTextField - Swing Text Field Class

 JComboBox - Swing Combo Box Class

 Menu Bar, Menus, Menu Items and Listeners

 Creating Internal Frames inside the Main Frame

 Layout of Components in a Container

 LookAndFeel and UIManager

 Option Dialog Boxes

 JEditorPane - The Editor Pane Class

 SwingWorker - The Background Task Worker

 AWT (Abstract Windows Toolkit)

 Integration with Desktop System

 Archived Tutorials

 References

 Full Version in PDF/EPUB