40 * It's used by the implementations of JTable, JTree, and JList. For example,
41 * here's how CellRendererPane is used in the code the paints each row
42 * in a JList:
43 * <pre>
44 * cellRendererPane = new CellRendererPane();
45 * ...
46 * Component rendererComponent = renderer.getListCellRendererComponent();
47 * renderer.configureListCellRenderer(dataModel.getElementAt(row), row);
48 * cellRendererPane.paintComponent(g, rendererComponent, this, x, y, w, h);
49 * </pre>
50 * <p>
51 * A renderer component must override isShowing() and unconditionally return
52 * true to work correctly because the Swing paint does nothing for components
53 * with isShowing false.
54 * <p>
55 * <strong>Warning:</strong>
56 * Serialized objects of this class will not be compatible with
57 * future Swing releases. The current serialization support is
58 * appropriate for short term storage or RMI between applications running
59 * the same version of Swing. As of 1.4, support for long term storage
60 * of all JavaBeans™
61 * has been added to the <code>java.beans</code> package.
62 * Please see {@link java.beans.XMLEncoder}.
63 *
64 * @author Hans Muller
65 * @since 1.2
66 */
67 @SuppressWarnings("serial") // Same-version serialization only
68 public class CellRendererPane extends Container implements Accessible
69 {
70 /**
71 * Construct a CellRendererPane object.
72 */
73 public CellRendererPane() {
74 super();
75 setLayout(null);
76 setVisible(false);
77 }
78
79 /**
80 * Overridden to avoid propagating a invalidate up the tree when the
|
40 * It's used by the implementations of JTable, JTree, and JList. For example,
41 * here's how CellRendererPane is used in the code the paints each row
42 * in a JList:
43 * <pre>
44 * cellRendererPane = new CellRendererPane();
45 * ...
46 * Component rendererComponent = renderer.getListCellRendererComponent();
47 * renderer.configureListCellRenderer(dataModel.getElementAt(row), row);
48 * cellRendererPane.paintComponent(g, rendererComponent, this, x, y, w, h);
49 * </pre>
50 * <p>
51 * A renderer component must override isShowing() and unconditionally return
52 * true to work correctly because the Swing paint does nothing for components
53 * with isShowing false.
54 * <p>
55 * <strong>Warning:</strong>
56 * Serialized objects of this class will not be compatible with
57 * future Swing releases. The current serialization support is
58 * appropriate for short term storage or RMI between applications running
59 * the same version of Swing. As of 1.4, support for long term storage
60 * of all JavaBeans
61 * has been added to the <code>java.beans</code> package.
62 * Please see {@link java.beans.XMLEncoder}.
63 *
64 * @author Hans Muller
65 * @since 1.2
66 */
67 @SuppressWarnings("serial") // Same-version serialization only
68 public class CellRendererPane extends Container implements Accessible
69 {
70 /**
71 * Construct a CellRendererPane object.
72 */
73 public CellRendererPane() {
74 super();
75 setLayout(null);
76 setVisible(false);
77 }
78
79 /**
80 * Overridden to avoid propagating a invalidate up the tree when the
|