Reputation: 1875
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
Upvotes: 0
Views: 120
Reputation: 39204
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());
Upvotes: 3