Difference between AWT and Swing in Java Last Updated : 11 Dec, 2022 Comments Improve Suggest changes 56 Likes Like Report Java is one of the most in-demand programming languages for developing a variety of applications. The popularity of Java can be attributed to its versatility as it can be used to design customized applications that are light and fast and serve a variety of purposes ranging from web services to android applications. Java is fast, reliable, and secure. There are multiple ways to develop GUI-based applications in java, out of which the most popular ones are AWT and Swing. Before getting into the differences, let us first understand what each of them is. 1. AWT AWT stands for Abstract Window Toolkit. It is a platform-dependent API to develop GUI (Graphical User Interface) or window-based applications in Java. It was developed by heavily Sun Microsystems In 1995. It is heavy-weight in use because it is generated by the system's host operating system. It contains a large number of classes and methods, which are used for creating and managing GUI. 2. Swing: Swing is a lightweight Java graphical user interface (GUI) that is used to create various applications. Swing has platform-independent components. It enables the user to create buttons and scroll bars. Swing includes packages for creating desktop applications in Java. Swing components are written in Java language. It is a part of Java Foundation Classes(JFC). Difference between AWT and Swing: S.NO AWT Swing 1.Java AWT is an API to develop GUI applications in JavaSwing is a part of Java Foundation Classes and is used to create various applications.2.The components of Java AWT are heavy weighted.The components of Java Swing are light weighted.3.Java AWT has comparatively less functionality as compared to Swing.Java Swing has more functionality as compared to AWT.4.The execution time of AWT is more than Swing.The execution time of Swing is less than AWT.5.The components of Java AWT are platform dependent.The components of Java Swing are platform independent.6.MVC pattern is not supported by AWT.MVC pattern is supported by Swing.7.AWT provides comparatively less powerful components.Swing provides more powerful components.8AWT components require java.awt package Swing components requires javax.swing package9AWT is a thin layer of code on top of the operating system.Swing is much larger swing also has very much richer functionality.10AWT stands for Abstract windows toolkit .Swing is also called as JFC(java Foundation classes). It is part of oracle's JFC.11Using AWT , you have to implement a lot of things yourself .Swing has them built in. Create Quiz Comment Y ypsjnv2013 Follow 56 Improve Y ypsjnv2013 Follow 56 Improve Article Tags : Java Difference Between java-swing Java-AWT Explore Java BasicsIntroduction to Java3 min readJava Programming Basics9 min readJava Methods6 min readAccess Modifiers in Java4 min readArrays in Java7 min readJava Strings7 min readRegular Expressions in Java3 min readOOP & InterfacesClasses and Objects in Java5 min readAccess Modifiers in Java4 min readJava Constructors4 min readJava OOP(Object Oriented Programming) Concepts10 min readJava Packages2 min readJava Interface7 min readCollectionsCollections in Java12 min readCollections Class in Java13 min readCollection Interface in Java4 min readIterator in Java4 min readJava Comparator Interface5 min readException HandlingJava Exception Handling6 min readJava Try Catch Block4 min readJava final, finally and finalize4 min readChained Exceptions in Java3 min readNull Pointer Exception in Java5 min readException Handling with Method Overriding in Java4 min readJava AdvancedJava Multithreading Tutorial3 min readSynchronization in Java7 min readFile Handling in Java4 min readJava Method References9 min readJava 8 Stream Tutorial7 min readJava Networking6 min readJDBC Tutorial5 min readJava Memory Management4 min readGarbage Collection in Java6 min readMemory Leaks in Java3 min readPractice JavaJava Interview Questions and Answers15+ min readJava Programs - Java Programming Examples7 min readJava Exercises - Basic to Advanced Java Practice Programs with Solutions5 min readJava Quiz1 min readJava Project Ideas For Beginners and Advanced15+ min read Like