The base class for all Swing components except top-level containers.
To use a component that inherits from
you must place the component in a containment hierarchy
whose root is a top-level Swing container.
Top-level Swing containers --
are specialized components
that provide a place for other Swing components to paint themselves.
For an explanation of containment hierarchies, see
Swing Components and the Containment Hierarchy,
a section in The Java Tutorial.
JComponent class provides:
javax.swing.plaf.ComponentUI. See How to Set the Look and Feel in The Java Tutorial for more information.
JComponentcontains all of the methods in the
Accessibleinterface, but it doesn't actually implement the interface. That is the responsibility of the individual classes that extend
getClientPropertymethods, you can associate name-object pairs with any object that descends from
Swing package descriptionand The Java Tutorial section The JComponent Class.
JComponent and its subclasses document default values
for certain properties. For example,
JTable documents the
default row height as 16. Each
that has a
ComponentUI will create the
ComponentUI as part of its constructor. In order
to provide a particular look and feel each
ComponentUI may set properties back on the
JComponent that created it. For example, a custom
look and feel may require
JTables to have a row
height of 24. The documented defaults are the value of a property
ComponentUI has been installed. If you
need a specific value for a particular property you should
explicitly set it.
In release 1.4, the focus subsystem was rearchitected. For more information, see How to Use the Focus Subsystem, a section in The Java Tutorial.
Warning: Swing is not thread safe. For more information see Swing's Threading Policy.
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans™
has been added to the