Swing is a user-interface toolkit in Java and is shipped with the standard Java SDK. It is contained within the package javax.swing.
Swing is a GUI toolkit that is packaged with the standard Java SDK (since 1.2). Recently it is no longer being actively enhanced and has largely been superseded by JavaFX.
General information
Specialized articles
Essential topics in Swing programming
Layout managers: Layout managers are responsible for determining the size and position of components in a Container
.
- Layout manager tutorial: complete tutorial on how to use layout managers
- Visual guide to layout managers: overview of the different layout managers and their main features
- Nesting layouts: allows designing almost any UI
Swing threading rules: Swing is single threaded and any access to Swing components should happen on the Swing thread (the Event Dispatch Thread or EDT).
- Start with the Concurrency in Swing tutorial
- Detect EDT violations using one of the approaches cited here
- Use
SwingWorker
to perform lengthy operations in the background and update the UI on theEDT
- Use a Swing
Timer
for animation