|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.awt.Component
![]()
![]()
![]()
java.awt.Container
![]()
![]()
![]()
javax.swing.CellRendererPane
, MenuContainer
, Serializable
, Accessible

public class CellRendererPane


This class is inserted in between cell renderers and the components that use them. It just exists to thwart the repaint() and invalidate() methods which would otherwise propagate up the tree when the renderer was configured. It's used by the implementations of JTable, JTree, and JList. For example, here's how CellRendererPane is used in the code the paints each row in a JList:
cellRendererPane = new CellRendererPane(); ... Component rendererComponent = renderer.getListCellRendererComponent(); renderer.configureListCellRenderer(dataModel.getElementAt(row), row); cellRendererPane.paintComponent(g, rendererComponent, this, x, y, w, h);
A renderer component must override isShowing() and unconditionally return true to work correctly because the Swing paint does nothing for components with isShowing false.
Warning:
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 JavaBeansTM
has been added to the java.beans package.
Please see XMLEncoder
.
| Nested Class Summary | |
|---|---|
protected class |
CellRendererPane.AccessibleCellRendererPane
This class implements accessibility support for the CellRendererPane class. |
Nested classes/interfaces inherited from class java.awt.Container ![]() |
|---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component ![]() |
|---|
Component.AccessibleAWTComponent |
| Field Summary | |
|---|---|
protected AccessibleContext |
accessibleContext
|
Fields inherited from class java.awt.Component ![]() |
|---|
BOTTOM_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver ![]() |
|---|
ABORT |
| Constructor Summary | |
|---|---|
CellRendererPane
Construct a CellRendererPane object. |
|
| Method Summary | |
|---|---|
protected void |
addImpl
If the specified component is already a child of this then we don't bother doing anything - stacking order doesn't matter for cell renderer components (CellRendererPane doesn't paint anyway).< |
AccessibleContext |
getAccessibleContext
Gets the AccessibleContext associated with this CellRendererPane. |
void |
invalidate
Overridden to avoid propagating a invalidate up the tree when the cell renderer child is configured. |
void |
paint
Shouldn't be called. |
void |
paintComponent
Calls this.paintComponent(g, c, p, x, y, w, h, false). |
void |
paintComponent
Paint a cell renderer component c on graphics object g. |
void |
paintComponent
Calls this.paintComponent() with the rectangles x,y,width,height fields. |
void |
update
Shouldn't be called. |
Methods inherited from class java.awt.Component ![]() |
|---|
action |