AWT Components Cheat Sheet Importing Libraries
There are two main libraries that involve the AWT tools. This package contains the core AWT graphics classes. Contains component classes for buttons, text fields, labels, frames, panels, dialogs, and scroll panes. It also contains the layout managers such as flow layout, border layout, and grid layout. Also included are the cusrom graphics classes such as graphics, color and font. Java Code: import java.awt.*;
Updated 10-30-2012 at 06:02 AM by penguinCoder
Swing contains a rich set of components as compared to AWT. They are purely build in Java and has following benefits as compared to AWT.
• Swing contains extra components like JTree, JTable etc.
• They can change skin based on current look and feel.
• They follow the MVC design pattern and are more flexible.
• Swing provided light weight components.
• Swing provides double buffering.
• Swing provides paint debugging.
Swing has following
When you use Java Swing or Java Foundation Classes (JFC) for your GUI application development the look and feel of GUI application is not the same as the look and feel of your operating system as JFC or Java Swing has its own built in look and feel. Although, if you want you can achieve the same look and feel as of your operating system's by using Java's Abstract Window Toolkit (AWT), the AWT toolkit is unable to meet advanced GUI programming requirement.
The Java Foundation Classes
AWT (the Abstract Windowing Toolkit) was the first Java GUI toolkit, introduced with JDK 1.0 as one component of the Sun Microsystems Java standard. The relatively primitive AWT wrapped Java code around native (operating system-supplied) objects to create GUI elements, such as menus, windows and buttons. AWT was a very thin wrapper around native widgets, exposing developers to platform specific code, quirks and bugs that limited how portable and native-looking applications could be across different