Hi all
I want to apply a renderer on a cell of my JTable, to do so I created a class named myRenderer :
import java.awt.Component; import javax.swing.ImageIcon; import javax.swing.JTable; import javax.swing.table.DefaultTableCellRenderer; public class MyRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, ImageIcon icon) { setIcon(icon); return this; } }
And I use this piece of code to apply the renderer on the cell :
MyRenderer renderer = new MyRenderer(); renderer.getTableCellRendererComponent(table, icon); table.getColumnModel().getColumn(6).setCellRenderer(renderer);
The problem is that the rebderer is applied on all the cells in the column 6, and I want it to be applied on one cell only (row/column) but I don't know how to do so ?
Thanks in advance