Java Utililty Methods JTable Cell Renderer

List of utility methods to do JTable Cell Renderer

Description

The list of methods to do JTable Cell Renderer are organized into topic(s).

Method

voidsetUpCellRenderer(JTable table)
set Up Cell Renderer
DefaultTableCellRenderer r = new DefaultTableCellRenderer() {
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
            boolean hasFocus, int row, int column) {
        Component renderer = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row,
                column);
        setBorder(BorderFactory.createEtchedBorder());
        return renderer;
};
int colCount = table.getColumnCount();
for (int i = 0; i < colCount; i++) {
    TableColumn col = table.getColumnModel().getColumn(i);
    col.setCellRenderer(r);