A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Swing / AWT / SWT
making a row grey in JTable
Joined: Jan 09, 2003
Jan 09, 2003 22:57:00
i m facing a problem in making a row grey which is not editable. Rest all the rows are editable. I have to make the first row grey. But when qrite code to make 1 row grey, it greys out the whole table.. do any1 have the solution
Joined: May 17, 2001
Jan 10, 2003 05:06:00
You need your own renderer (implement TableCellRenderer). Override this method:
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
Just check on what you need and set the color.
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: making a row grey in JTable
Enabling/Disabling Rows in JTable
make html fields not changable
Converting non-editable pdfs to editable pdfs
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015