I am implementing a JTable
containing some JButton
, and I found this nice example upon which I based my table.
I tried to implement my own table to suit my needs, using the files ButtonEditor.java
and ButtonRenderer.java
from the example.
Actually, the column named "1
" is made of buttons, and I would like to assign a different String myString to each one.
With a simple modification of the ButtonEditor
class I assign the same myString to the whole column using:
table.getColumn("1").setCellRenderer(new ButtonRenderer());
table.getColumn("1").setCellEditor(new ButtonEditor(new JCheckBox(), myString));
but it's not what I want. I would like to choose the row as well.
So how do I have to modify the ButtonEditor
class to accomplish this ?