Swing is a collection of set of classes that provides more powerful and flexible GUI components when compared to AWT components. Swing did not exist in the early days of Java. The swing was a solution to the problems present in Java's AWT. The AWT defines basic set of controls, windows, dialog boxes. But it has limited graphical interface. AWT components are heavy weight. i.e., these components are dependent on native operating system. Swing components are light weight i.e., these components are independent of operating system.
Swing was introduced in 1997, included as a part of the Java Foundation Classes (JFC). Swing was initially available with JAVA 1.1 as a seperate library Begining with Java 1.2, Swng was fully integrated into Java.
Swing is built on the top of AWT. Swing also uses the same event handling mechanism as the AWT. Then we must have a basic knowledge about the AWT and of event handling.
YOU CAN"T BE A GREAT JAVA PROGRAMMER WITHOUT KNOWING THE AWT.
The swng GUI consists of two key items:
- Components
- Containers
A component is an independent visual control, such as button, text field and etc.
A container is a special type of component that is designed to hold other components.
Components: Swing components are derived from the JComponent class. This JComponent is inherited from Component and Container in AWT. There are several Swing Components.
08:25
Share:
0 comments: