Difference between AWT and Swing in Java

Here you will learn about difference between AWT and Swing in Java.

 

AWT and Swing both are used to create GUI interface in Java. Both of them are used to perform almost same work, still they differ from each other. In this tutorial I have shared about some differences between AWT and Swing.

 

Also Read: Difference between Abstract Class and Interface in Java 

Difference between AWT and Swing in java

AWT
Swing
AWT stands for Abstract Window Toolkit.
Swing is a part of Java Foundation Class (JFC).
AWT components are heavy weight.
Swing components are light weight.
AWT components are platform dependent so there look and feel changes according to OS.
Swing components are platform independent so there look and feel remains constant.
AWT components are not very good in look and feel as compared to Swing components. See the button in below image, its look is not good as button created using Swing.
 
Difference between AWT and Swing
Swing components are better in look and feel as compared to AWT. See the button in below image, its look is better than button created using AWT.
 
Difference between AWT and Swing

 

If you know about any other difference between AWT and Swing than please mention it by commenting below.

8 thoughts on “Difference between AWT and Swing in Java

  1. Rajan karki

    yes, really the above table has the main difference between AWT and Swing, and i want to know other difference between them?Thanks in advance.

    Reply
  2. krishna

    Awt components requres java.awt package
    Swing components requries javax.swing packagw

    Reply

Leave a Reply

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