Swing Is Built on the Abstract Window Toolkit (AWT)
Since before moving on to the swing it is necessary to make one thing important and that is: although Swing has eliminated a number of the limitations that inherent in the AWT but Swing does not replace it.
Instead the Swing is actually built on the foundation of AWT.
This is why the AWT is still an important part of Java.
The Swing also uses the same event handling mechanisms and the Layout Managers as in the AWT. Therefore, a basic understanding of AWT is strictly required to use Swing.
Swing can be included in a java programs as
Import javax.swing.*;
The Two Key Swing Features as
Since As just explained the Swing was created to address limitations that are present in the AWT and It does this through two key features:-
1)Swing Components Are the Lightweight component
With the very few exceptions, the Swing components are lightweight which means that they are written entirely in Java and does not require any native program to implement it.
2)Swing Supports a Pluggable Look and Feel(PLAF)
Swing supports PLAF, Because each Swing component is rendered by some Java code rather than by native the peers, the look and feel of a component is as under the control of Swing and This fact means that it is possible to separate the look and feel of a component from logic of the component.
Detailed Features of Swing
- The Swing API is for advanced graphical programming.
- The Accessibility API provides the assistive technology for the API.
- The Java API is for high quality 2D graphics and images.
- The Pluggable look & feel supports.
- The Light weighted components.
- The Drag and drop support between the Java and native applications.
- The Swing components facilitate an efficient graphical user interface (GUI) development and These components has a collection of lightweight visual components.
- The Swing components contains a replacement for the heavyweight AWT components as well as the complex user-interface components as trees and tables.