Java 在特定JTable单元格中显示图标

Java 在特定JTable单元格中显示图标,java,swing,jtable,icons,Java,Swing,Jtable,Icons,我希望在特定的JTable单元格中显示图标,而不是在整个列的单元格中显示相同的图标 假设您已经完成了您的工作,并且知道如何使用,那么基本概念很简单 public Component getTableCellRendererComponent( JTable table, Object color, boolean isSelected, boolean hasFocus,

我希望在特定的
JTable
单元格中显示图标,而不是在整个列的单元格中显示相同的图标

假设您已经完成了您的工作,并且知道如何使用,那么基本概念很简单

public Component getTableCellRendererComponent(
                        JTable table, Object color,
                        boolean isSelected, boolean hasFocus,
                        int row, int column) {
    // Prepare renderer as usual...

    // Check to see if the current row/column is within 
    // the acceptable range...
    // It would be usful if this information was coming from
    // some kind of model
    if (row == iconRow && column == iconColumn) {
        // Apply the icon for this cell renderer
    }
    return this;
}

请编辑您的问题,以包括一个显示您尝试了什么的问题。