public interface TableCellRenderer 
      JTable中单元格的渲染器的对象所需的方法。 
      Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
 TableCellRenderer还负责呈现表格当前DnD放置位置的单元格(如果有)。 如果此渲染器关心呈现DnD放置位置,则应直接查询表,以查看给定的行和列是否表示放置位置: 
  JTable.DropLocation dropLocation = table.getDropLocation();
     if (dropLocation != null
             && !dropLocation.isInsertRow()
             && !dropLocation.isInsertColumn()
             && dropLocation.getRow() == row
             && dropLocation.getColumn() == column) {
         // this cell represents the current drop location
         // so render it specially, perhaps with a different color
     }  
            在打印操作期间,此方法将被调用isSelected个hasFocus的值false ,以防止选择和从出现在打印输出聚焦。 要根据是否打印表进行其他自定义,请从JComponent.isPaintingForPrint()检查返回值。 
table - 要求渲染器绘制的JTable ; 
            可以null 
           value - 要呈现的单元格的值。 
            由具体的渲染器来解释和绘制价值。 
            例如,如果value是字符串“true”,则可以将其呈现为字符串,或者可以将其value为已选中的复选框。 
            null是一个有效的值 
           isSelected - 如果要突出显示的选择要呈现单元格,则为true; 
            否则为虚假 
           hasFocus - 如果为true,则适当地渲染单元格。 
            例如,在单元格上放置一个特殊的边框,如果可以编辑单元格,则以用于指示编辑的颜色进行渲染 
           row - 要绘制的单元格的行索引。 
            绘制标题时, row值为-1 
           column - 要绘制的单元格的列索引 
           JComponent.isPaintingForPrint() 
            Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.