Usman Ahmed
Usman Ahmed

Reputation: 79

JTable Look and Feel

How to change the JTable's font's colors when editing by double click. There is JTable's background color, JTable's foreground color and selection colors. How to change the colors of JTables cell editing text.

Thankyou.

Upvotes: 1

Views: 256

Answers (1)

kleopatra
kleopatra

Reputation: 51525

Assuming you mean to change the color of the cell while editing that cell: configure the textField used by the cellEditor:

JTextField field = new JTextField();
field.setForeground(Color.RED);
table.setDefaultEditor(Object.class, new DefaultCellEditor(field));

Upvotes: 3

Related Questions