I like to create a cell with a checkbox and one or two optional textfields.
If I click on the checkbox the textfields get visible. I tried to make an ASCII picture how it should look like:
[ ]
[X] [some string]
[X] [value1] [value2]
I know how to create a custom renderer but I am not sure how to return multiple elements. If I have a renderer for a checkbox I return only the JCheckBox:
class BooleanRenderer extends JCheckBox implements TableCellRenderer, UIResource
{
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
// doing some stuff...
return this;
}
}