All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.ui.framework.java.TableItemCellRenderer

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----javax.swing.JComponent
                           |
                           +----javax.swing.JLabel
                                   |
                                   +----javax.swing.table.DefaultTableCellRenderer
                                           |
                                           +----com.ibm.as400.ui.framework.java.TableItemCellRenderer

public class TableItemCellRenderer
extends DefaultTableCellRenderer
An extension of DefaultTableCellRenderer that performs all the same function as the base class, and additionally supports displaying icons on items in table columns if the items have an image associated with them. A cell renderer class can be specified on the Renderer property of a table column in the GUI Builder. This will result in an object of the specified Renderer class being attached to the the TableColumn associated with that column of data in the Table. This renderer object will be used to render all items in this column. Whenever an item in the column needs to be drawn, a call will be made to the renderer object's getTableCellRendererComponent method.

To display an item in the column, this renderer will use the icon, icon positioning attributes, and text from the ItemDescriptor associated with the cell being drawn.

See Also:
DefaultTableCellRenderer

Constructor Index

 o TableItemCellRenderer()
Constructs a TableItemCellRenderer object.

Method Index

 o getTableCellRendererComponent(JTable, Object, boolean, boolean, int, int)
Sets up the Component to be used to render the cell.

Constructors

 o TableItemCellRenderer
 public TableItemCellRenderer()
Constructs a TableItemCellRenderer object.

Methods

 o getTableCellRendererComponent
 public Component getTableCellRendererComponent(JTable table,
                                                Object value,
                                                boolean iss,
                                                boolean chf,
                                                int row,
                                                int column)
Sets up the Component to be used to render the cell. We call the super class's method to do all the standard processing, and then process set the icon and adjust the text position if necessary.

Parameters:
table - JTable to which this cell belongs
value - Object to display
iss - Boolean indicating if the cell is selected
chf - Boolean indicating if the cell has focus
row - row number of the cell
column - column number of the cell
Overrides:
getTableCellRendererComponent in class DefaultTableCellRenderer

All Packages  Class Hierarchy  This Package  Previous  Next  Index