File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "making a row grey in JTable" Watch "making a row grey in JTable" New topic

making a row grey in JTable

Pristi Sanyal

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.
I agree. Here's the link:
subject: making a row grey in JTable
It's not a secret anymore!