0

I'm trying to make a simple properties window using JTable with two columns: Property and Value. I want 'Value' column to be either textedit or checkbox. How to achive it?

Thanks in advance

Mariusz
  • 1,825
  • 5
  • 22
  • 36

1 Answers1

3

You should implement your custom TableCellRenderer and TableCellEditor.

Then retrieve the TableColumn you need to customize and set your class where you implemented those interfaces.

TableColumn column = table.getColumnModel().getColumn(vColIndex);
column.setCellRenderer(new YourCustomCellRenderer());
column.setCellEditor(new YourCustomCellEditor());
kleopatra
  • 51,061
  • 28
  • 99
  • 211
Heisenbug
  • 38,762
  • 28
  • 132
  • 190