Renderer in TableModel

I

Ike

I have a TableModel which extends AbstractTableModel. One of the columns I
have is of possible Booleans.

However, not ever row has a value - the Booleans occur sparsely as you
travers down the rows.

I'm trying to figure out how I can have a checkbox in only those cells in
this column which actually HAVE a boolean value, and no check box in the
cell if the value is null. Unfortunately, it seems, AbstractTableModel
interface implementation puts the editor in ever cell of a given column.

Anyone know any way around this? Thanks, Ike
 
I

Ike

But how do you mae individual cells be invisible in a derivation of
AbstractTableModel? -Ike
 
A

ak

Hmm, write your own TableCellEditor.

you need to implement only one method:

public Component getTableCellEditorComponent(JTable table,
Object value,
boolean isSelected,
int row,
int column)

row and column are known, try to return null if cell is empty.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top