This is an example of a library. You may see a list of other libraries used on Rosetta Code at Category:Solutions by Library.
Swing is a toolkit. It provides a system for creation and management of graphical user interface elements.

Swing is a lightweight GUI framework for Java built on top of AWT which provides a look-and-feel closer to the platform upon which Java is running, or a look-and-feel of the programmer's choosing. It relies on AWT's Containers, but instead of relying on the OS for widget rendering, it renders itself. This feature gives it its lightweight nature.