posted 22 years ago
I am not very familiar with swing. I am trying to use some JComponent in a table. The problem is, though I see the JComponents in the cells, they dont receive any event. I set a custom TableCellRenderer for JComponent type. Here is the code,
table.setDefaultRenderer(javax.swing.JComponent.class,
new TableCellRenderer() {
public Component getTableCellRendererComponent(JTable table,
Object value, boolean isSelected, boolean hasFocus,
int row, int column) {
return (JComponent) table.getValueAt(row, column);
}
});
setMiddleComponent(table);
}
Also, I have those JComponents in the table model, is this design ok for mvc?
I will be very glad if you have the answer, or you can point me to any resource that duscusses this issue.
Thanks.
tobe bondhu nouka bherao<br />shonabo gaan aj shara raat