站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

Java(TM) 2 Platform, Standard Edition, v1.2.2 API Specification: Interface TableCellRenderer - JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

JavaTM 2 Platform
Standard Edition

javax.swing.table
Interface TableCellRenderer

All Known Implementing Classes:
DefaultTableCellRenderer

public interface TableCellRenderer

This interface defines the methods any object that would like to be a renderer for cell in a JTable.


Method Summary
 Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
          This method is sent to the renderer by the drawing table to configure the renderer appropriately before drawing.
 

Method Detail

getTableCellRendererComponent

public Component getTableCellRendererComponent(JTable table,
                                               Object value,
                                               boolean isSelected,
                                               boolean hasFocus,
                                               int row,
                                               int column)
This method is sent to the renderer by the drawing table to configure the renderer appropriately before drawing. Return the Component used for drawing.
Parameters:
table - the JTable that is asking the renderer to draw. This parameter can be null.
value - the value of the cell to be rendered. It is up to the specific renderer to interpret and draw the value. eg. if value is the String "true", it could be rendered as a string or it could be rendered as a check box that is checked. null is a valid value.
isSelected - true is the cell is to be renderer with selection highlighting
row - the row index of the cell being drawn. When drawing the header the rowIndex is -1.
column - the column index of the cell being drawn

JavaTM 2 Platform
Standard Edition

Submit a bug or feature
Java, Java 2D, and JDBC are a trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.