Arpan
Arpan

Reputation: 626

How to override Default cell editor in a jTable?

I want to change the properties of DefaultCellEditor in a jTable so that I can customize the font type, size, color, background color etc of a cell in edit mode.

Upvotes: 0

Views: 1649

Answers (2)

camickr
camickr

Reputation: 324098

table.setDefaultEditor(Object.class, customEditor)

Upvotes: 2

Sergiy Medvynskyy
Sergiy Medvynskyy

Reputation: 11327

You can set your own cell editor which is probably derived from the DefaultCellEditor. Use

     table.getColumnModel().getColumn(column).setCellEditor(myEditor);

To set your editor into the table.

Upvotes: 1

Related Questions