The Swing library in Java is part of JFC (Java Foundation Classes). It provides graphical user interface (GUI) components for Java applications.
Though powerful, the hierarchy of Swing classes can be a bit tricky. At the top, you have java.lang.Object since all Java classes inherit from it.
The key classes under javax.swing include:
- JComponent: The base class for all Swing components.
- Container: This is a sub-class of Component and can contain other components.
- JFrame, JPanel, JButton: Examples of standard components used in GUI construction.
Understanding this hierarchy helps in building complex UIs effectively.