This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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
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.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: making a row grey in JTable
 
It's not a secret anymore!