my dog learned polymorphism*
The moose likes Swing / AWT / SWT and the fly likes making a row grey in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "making a row grey in JTable" Watch "making a row grey in JTable" New topic
Author

making a row grey in JTable

Pristi Sanyal
Greenhorn

Joined: Jan 09, 2003
Posts: 1
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
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
You need your own renderer (implement TableCellRenderer). Override this method:

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
 
Similar Threads
Enabling/Disabling Rows in JTable
make html fields not changable
Help with JavaScript Drop Down Box
Help with JavaScript Drop Down Box
Converting non-editable pdfs to editable pdfs