Difference between AWT and Swing in java

AWT

Swing

AWT stands for Abstract Window Toolkit.

&IT TAKES MORE MEMORY 

Swing is a part of Java Foundation Class (JFC).

&IT TAKES LESS MEMORY 

AWT components are heavy weight.

&java.awt package required 

Swing components are light weight.

javax.swing package required 

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

 

Leave a comment