🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › awt › package-summary.html
java.awt (Java Platform SE 8 )
2 weeks ago - Java™ Platform Standard Ed. 8 ... Contains all of the classes for creating user interfaces and for painting graphics and images. ... Contains all of the classes for creating user interfaces and for painting graphics and images. A user interface object such as a button or a scrollbar is called, ...
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-awt-tutorial
Java AWT Tutorial - GeeksforGeeks
August 11, 2023 - Learn the basics of the Abstract Window Toolkit (AWT) in Java, for both beginners and experienced developers.
standard Java library for graphical user interfaces, succeeded by Swing
Abstract Window Toolkit - Wikipedia
The Abstract Window Toolkit (AWT) is Java's original platform-dependent windowing, graphics, and user-interface widget toolkit, preceding Swing. The AWT is part of the Java Foundation Classes (JFC) — the standard API for … Wikipedia
🌐
Wikipedia
en.wikipedia.org › wiki › Abstract_Window_Toolkit
Abstract Window Toolkit - Wikipedia
3 weeks ago - The Abstract Window Toolkit (AWT) is Java's original platform-dependent windowing, graphics, and user-interface widget toolkit, preceding Swing. The AWT is part of the Java Foundation Classes (JFC) — the standard API for providing a graphical user interface (GUI) for a Java program.
🌐
Oracle
docs.oracle.com › javase › 7 › docs › api › java › awt › package-summary.html
java.awt (Java Platform SE 7 )
Java™ Platform Standard Ed. 7 ... Contains all of the classes for creating user interfaces and for painting graphics and images. ... Contains all of the classes for creating user interfaces and for painting graphics and images. A user interface object such as a button or a scrollbar is called, ...
🌐
TutorialsPoint
tutorialspoint.com › awt › index.htm
AWT Tutorial
AWT stands for Abstract Window Toolkit. It is an initial toolkit library provided by Java to create a Graphical User Interface. This tutorial is designed for Software Professionals who are willing to learn JAVA GUI Programming in simple and easy
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › awt › Component.html
Component (Java Platform SE 8 )
2 weeks ago - Due to the asynchronous nature of native event handling, this method can return outdated values (for instance, after several calls of setLocation() in rapid succession). For this reason, the recommended method of obtaining a component's position is within java.awt.event.ComponentListener.componentMoved(), which is called after the operating system has finished moving the component.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › technotes › guides › awt › index.html
Abstract Window Toolkit (AWT)
October 20, 2025 - Java SE 8 Documentation · Search · The Abstract Window Toolkit (AWT) supports Graphical User Interface (GUI) programming. AWT features include: A set of native user interface components · A robust event-handling model · Graphics and imaging tools, including shape, color, and font classes ·
🌐
OpenJDK
openjdk.org › groups › awt
AWT Group
The AWT (Abstract Window Toolkit) provides an interface between a Java application and a native windowing system. AWT comprises the event handling system as well as a set of so-called heavyweight GUI components, including the top-level components such as frames and dialogs.
Find elsewhere
🌐
Lehigh
cse.lehigh.edu › ~glennb › oose › java › javaawt.htm
Java AWT tutorial
The Java Abstract Window Toolkit provides a cross-platform library which seeks to observe look-and-feel conventions of various OS platforms. Toolkit --------------------------------------------------------- AWT --------|--------- Button List JVM ------|-------------|-----------------------...
🌐
Javatpoint
javatpoint.com › java-awt
Java AWT Tutorial
Java Toolkit class is the abstract superclass of every implementation in the Abstract Window Toolkit. Subclasses of Toolkit are used to bind various components. It inherits Object class. class declaration public abstract class Toolkit extends Object Java Example import java.awt.*; public class ...
🌐
Java
download.java.net › java › early_access › loom › docs › api › java.desktop › java › awt › package-summary.html
java.awt (Java SE 25 & JDK 25 [build 1])
Provides interfaces and classes for dealing with different types of events fired by AWT components. ... Provides classes and interface relating to fonts. ... Provides the Java 2D classes for defining and performing operations on objects related to two-dimensional geometry.
🌐
Oracle
docs.oracle.com › javase › 10 › docs › api › java › awt › package-summary.html
java.awt (Java SE 10 & JDK 10 )
Contains all of the classes for creating user interfaces and for painting graphics and images. A user interface object such as a button or a scrollbar is called, in AWT terminology, a component. The Component class is the root of all AWT components.
🌐
BeginnersBook
beginnersbook.com › 2015 › 06 › java-awt-tutorial
Java AWT tutorial for beginners
September 11, 2022 - AWT stands for Abstract Window Toolkit. It is a platform dependent API for creating Graphical User Interface (GUI) for java programs.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › awt › event › package-summary.html
java.awt.event (Java Platform SE 8 )
October 20, 2025 - Provides interfaces and classes for dealing with different types of events fired by AWT components. See the java.awt.AWTEvent class for details on the AWT event model. Events are fired by event sources. An event listener registers with an event source to receive notifications about the events of a particular type.
🌐
Oracle
docs.oracle.com › en › java › javase › 19 › docs › api › java.desktop › java › awt › package-summary.html
java.awt (Java SE 19 & JDK 19)
December 12, 2022 - Provides interfaces and classes for dealing with different types of events fired by AWT components. ... Provides classes and interface relating to fonts. ... Provides the Java 2D classes for defining and performing operations on objects related to two-dimensional geometry.
🌐
YouTube
youtube.com › playlist
JAVA AWT TUTORIAL - YouTube
Learn everything about AWT(Abstract Window Toolkit in Java). AWT is used is create GUI-based applications in Java. In this tutorial, I have explained each co...
Top answer
1 of 9
264

AWT is a Java interface to native system GUI code present in your OS. It will not work the same on every system, although it tries.

Swing is a more-or-less pure-Java GUI. It uses AWT to create an operating system window and then paints pictures of buttons, labels, text, checkboxes, etc., into that window and responds to all of your mouse-clicks, key entries, etc., deciding for itself what to do instead of letting the operating system handle it. Thus Swing is 100% portable and is the same across platforms (although it is skinnable and has a "pluggable look and feel" that can make it look more or less like how the native windows and widgets would look).

These are vastly different approaches to GUI toolkits and have a lot of consequences. A full answer to your question would try to explore all of those. :) Here are a couple:

AWT is a cross-platform interface, so even though it uses the underlying OS or native GUI toolkit for its functionality, it doesn't provide access to everything that those toolkits can do. Advanced or newer AWT widgets that might exist on one platform might not be supported on another. Features of widgets that aren't the same on every platform might not be supported, or worse, they might work differently on each platform. People used to invest lots of effort to get their AWT applications to work consistently across platforms - for instance, they may try to make calls into native code from Java.

Because AWT uses native GUI widgets, your OS knows about them and handles putting them in front of each other, etc., whereas Swing widgets are meaningless pixels within a window from your OS's point of view. Swing itself handles your widgets' layout and stacking. Mixing AWT and Swing is highly unsupported and can lead to ridiculous results, such as native buttons that obscure everything else in the dialog box in which they reside because everything else was created with Swing.

Because Swing tries to do everything possible in Java other than the very raw graphics routines provided by a native GUI window, it used to incur quite a performance penalty compared to AWT. This made Swing unfortunately slow to catch on. However, this has shrunk dramatically over the last several years due to more optimized JVMs, faster machines, and (I presume) optimization of the Swing internals. Today a Swing application can run fast enough to be serviceable or even zippy, and almost indistinguishable from an application using native widgets. Some will say it took far too long to get to this point, but most will say that it is well worth it.

Finally, you might also want to check out SWT (the GUI toolkit used for Eclipse, and an alternative to both AWT and Swing), which is somewhat of a return to the AWT idea of accessing native Widgets through Java.

2 of 9
38

The base difference that which already everyone mentioned is that one is heavy weight and other is light weight. Let me explain, basically what the term heavy weight means is that when you're using the awt components the native code used for getting the view component is generated by the Operating System, thats why it the look and feel changes from OS to OS. Where as in swing components its the responsibility of JVM to generate the view for the components. Another statement which i saw is that swing is MVC based and awt is not.

🌐
Oracle
docs.oracle.com › en › java › javase › 21 › docs › api › java.desktop › java › awt › package-summary.html
java.awt (Java SE 21 & JDK 21)
January 20, 2026 - Provides interfaces and classes for dealing with different types of events fired by AWT components. ... Provides classes and interface relating to fonts. ... Provides the Java 2D classes for defining and performing operations on objects related to two-dimensional geometry.
🌐
Studytonight
studytonight.com › java › java-awt.php
https://www.studytonight.com/java/java-awt.php
Java AWT is an API that contains large number of classes and methods to create and manage graphical user interface ( GUI ) applications. The AWT was designed to provide a common set of tools for GUI design that could work on a variety of platforms. The tools provided by the AWT are implemented ...