get Rendered Component At JTable cell - Java Swing

Java examples for Swing:JTable Cell

Description

get Rendered Component At JTable cell

Demo Code


//package com.java2s;
import java.awt.Component;

import javax.swing.JTable;

public class Main {
    public static Component getRenderedComponentAt(JTable table,
            int rowIndex, int columnIndex) {
        return table.getCellRenderer(rowIndex, columnIndex)
                .getTableCellRendererComponent(table,
                        table.getValueAt(rowIndex, columnIndex),
                        table.isCellSelected(rowIndex, columnIndex), false,
                        rowIndex, columnIndex);
    }//from   w  w w.ja  va 2  s  . c  o  m
}

Related Tutorials