Swing is a windowing class library for Java.

Initially Swing was part of the Java Foundation Classes (JFC), a separate API distribution from Sun, before it was integrated into the standard Java class library with the Java 2 platform and JDK 1.2.

Prior to Swing, Java's only standard tool for creating GUIs was the Abstract Windowing Toolkit, or AWT. AWT uses calls into the native operating system to create graphical controls and windows, and therefore applications written using AWT take on much of the look and feel of the underlying windowing system. Because AWT is dependant on native system calls, it is termed a heavyweight class library.

Contrastingly, Swing is lightweight, meaning that is uses no native system calls, except those used by AWT, upon which it is dependant. Swing renders its window controls using primitive draw instructions, and therefore applications built with Swing have a specifically Swing look and feel rather than that of the OS. This is both good and bad, as it gives applications more control over their appearance than AWT applications, but also may appear disconcerting to end users.