Difference between AWT and Swing in Java
AWT:
In Java, The Abstract Window Toolkit (AWT) package enables the programming used to create GUI-based applications. It contains several classes that help to implement common window-based tasks. such as windows, adding scroll bar, buttons, list items, text boxes, etc. All the classes are contained in the [java]java.awt[/java] package.
Swing:
Swing is a GUI toolkit that facilitates the creation of highly interactive GUI applications. It is more flexible and robust when it comes to implementing graphical components.
AWT vs Swing:
1. AWT stands for Abstract Windows Toolkit | 1. Swing is also known as JFC (Java Foundation Classes) |
2. AWT components are called Heavy-weight component | 2. Swing components are called light-weight component |
3. AWT components require java.awt package | 3. Swing components require javax.swing package |
4. It's components are platform dependent | 4. It's components are platform independent |
5. It's execution is slower | 5. It's execution is faster |
6. It doesn't support MVC Pattern. | 6. It supports MVC Pattern. |