Java provides a huge library for graphical programming. Earlier object oriented languages used to have a very poor user interface.
In Java, AWT (Abstract Window Toolkit) is used for GUI programming.
AWT is a platform dependent API to develop GUI or window-based application. It comes in Java 1.0 for graphical programming.
AWT provides the better look for user environment. It is a heavyweight component.
package.
Applet, Button, Canvas, Menu, Label, List, Frame, Panel, Window etc.
Swing is also used for Java graphics. Java Swing is one of the parts of
(JFC). JFC provides the rich graphics programming for the Graphical User Interface.
AWT | Swing |
---|
The components of AWT start without letter J. For example: Applet, Button, Canvas, Menu, Label etc. | The components of the Swing begin with letter J. For Example: JButton, JApplet, JCheckBox etc. |
AWT components are the Heavyweight components. | Swing components are the Lightweight components. |
AWT components are platform dependent. | Swing components are less dependent on platform and use less of the native GUI resource. |
AWT components are not very good in look and feel. | Swing components are better in look and feel. |
It doesn’t have innovative tools. | Swing has innovative tools such as Border in any type (setBorder()), Graphical debugging, pluggable look etc. |
AWT doesn’t follow MVC architecture. | Swing follows the MVC architecture. |