JComponent is the base class for all Java Swing components except top-level containers.
JComponent is the base class for all Java Swing components except top-level containers which descend from Window instead.
To use a component that inherits from JComponent
, you must place the component in a containment hierarchy whose root is a top-level Swing container. Top-level Swing containers -- such as JFrame
, JDialog
, and JApplet
-- are specialized components that provide a place for other Swing components to paint themselves.