I have a JTable
with a model created like this :
DefaultTableModel model = new DefaultTableModel(new Object[][] {},new String[] {"Col1", "Col2", "Col3", "Col4", "Col5", "Col6", "Col7", "Col8"}) {
@Override
public Class<?> getColumnClass(int column) {
switch (column) {
case 0: return ImageIcon.class;
case 7: return JButton.class;
default: return String.class;
}
}
};
table = new JTable(model);
But when I use the addRow
method, My ImageIcon
appears properly but not the JButton
. In fact, I get something like javax.Swing.JButt...
instead of the JButton
!