Difference between AWT vs Swing


AWT stands for Abstract Window Toolkit. It is responsible for handling all the user-interface and graphics tools. It is the part of the JFC (Java Foundation Class), which is the standardized API for Graphical user-interface for any program. AWT ensures that your program will be well interpreted by the user.



Swing is the advanced and modern toolkit for Java. It is also a part of the JFC (Java Foundation Class). It has more personalized and sophisticated features over the earlier Abstract Window Toolkit (AWT). It emulates a better look and feels for your program.


Comparison between AWT and SWING:

  1. AWT components are also referred to as Heavyweight components, whereas; the swing components are also known as Lightweight components.
  2. AWT components work on java.awt package, whereas; the swing component works on javax.swing package.
  3. AWT components are very platform sensitive, whereas; the swing components are platform independent.
  4. The swing components provide a great look and feel for the program, whereas; AWT does not support this feature.
  5. Swing has many advanced features which are not available in AWT like JButton, JDialog, JTextArea, etc. Its components are not native to any Operating System, which in turn provides swing components with those lightweight features.
  6. AWT is a very fine layer of code that lies over the operating system, whereas; the swing is quite larger as it is well defined and is not OS dependent.
  7. AWT has no richer functionality because of its dependent code, whereas; the swing has very rich functionality because of its well-defined structure.
  8. While working with AWT you have to implement many things on your own, whereas; while working with Swing all the functionalities are already built-in.
  9. AWT components being Heavyweight takes a longer time to load, whereas; the swing components being Lightweight loads up very quickly.
  10. AWT does not follow MVC (Modern View Control), whereas; the swing follows MVC.
  11. AWT has a lesser number of well-defined components, whereas; the swing has a higher number of well-defined components.
  12. AWT has an old and unappealing graphical user interface (GUI), whereas; the swing has modernized and illustrative graphical user interface (GUI).
  13. AWT components require a large amount of memory space, whereas; the swing components does not require any memory space.



Posted in Articles and tagged , , , , .

Leave a Reply

Your email address will not be published. Required fields are marked *