• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

making a row grey in JTable

 
Pristi Sanyal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need your own renderer (implement TableCellRenderer). Override this method:

Just check on what you need and set the color.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic