1. Swing overview
The GUI (graphical user interface) provides a graphical interface for the program, originally designed to build a common GUI for programmersto run on all platforms . However, the basic class AWT(Abstract window Toolbox) in Java 1.0 did not meet this requirement, so Swing appeared, which is an enhanced component of the AWT component, but it does not completely replace the AWT components . Both of these components need to appear in a graphical user interface at the same time .
2. Swing Features
Swing components are often referred to as "lightweight components" because they are written entirely in the Java language, and Java is a language that does not depend on the operating system, and it can run on any platform, whereas a component that relies on the local platform is called a "heavyweight component". For example, the AWT component is a window system that relies on the local platform to determine the functionality, appearance, and style of the GUI components. Swing has the following main features:
1) Lightweight components
2) Pluggable appearance components
3. Swing Package
Detailed illustrations:
Most GUI components in swing components sick a direct subclasses or indirect subclasses of the component class, and the JComponent class is where the various features of the swing component reside, including component boundaries and automatic scrolling of GUI components.
Chapter 13th Swing Program components