Hi,
I have a very standard JTable which just takes a 2 dimensional array of objects as normal and shows the String representation of these objects.
This I understand, however I know there is a way to insert other objects besids the allowed Components such as JComboBox, JCheckBox etc.
Here' what I tried, alas to no-avail.
-------------------code---------------------
JTable resultsTable = new JTable(data, columnNames);
TableColumn resultsColumn = resultsTable.getColumnModel().getColumn(4);
resultsColumn.setCellEditor(new showButton(new JButton("testing"
));
----------------------------------------
inner class showButton
----------------------------------------
class showButton extends DefaultCellEditor
{
public showButton(JButton b)
{
super(new JCheckBox());
editorComponent = b;
setClickCountToStart(0);
}
}
------------------------------------------
I am very new to JTables so any and all suggstions and commnts will be very welcome!
Thanks,
Oxy we are all of us living in the gutter.
But some of us are looking at the stars.
I have a very standard JTable which just takes a 2 dimensional array of objects as normal and shows the String representation of these objects.
This I understand, however I know there is a way to insert other objects besids the allowed Components such as JComboBox, JCheckBox etc.
Here' what I tried, alas to no-avail.
-------------------code---------------------
JTable resultsTable = new JTable(data, columnNames);
TableColumn resultsColumn = resultsTable.getColumnModel().getColumn(4);
resultsColumn.setCellEditor(new showButton(new JButton("testing"
----------------------------------------
inner class showButton
----------------------------------------
class showButton extends DefaultCellEditor
{
public showButton(JButton b)
{
super(new JCheckBox());
editorComponent = b;
setClickCountToStart(0);
}
}
------------------------------------------
I am very new to JTables so any and all suggstions and commnts will be very welcome!
Thanks,
Oxy we are all of us living in the gutter.
But some of us are looking at the stars.