The example i have found: http://www.java2s.com/Code/Java/Swing-Components/ButtonTableExample.htm show how to create a JTable with specified column (button). It works properly, but the my problem is, that i need to use AbstractTableModel instead of DefaultTableModel (as at the example shows).
So i created my own TableModel, which extends AbstractTableModel:
public class TableModel extends AbstractTableModel {
//..
}
and replaced:
DefaultTableModel dm = new DefaultTableModel();
dm.setDataVector(new Object[][] { { "button 1", "foo" },
{ "button 2", "bar" } }, new Object[] { "Button", "String" });
JTable table = new JTable(dm);
for:
JTable table = new JTable(new TableModel());
And then nothing happens, when i will click button at some row. Any suggestions?