Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

rendering color to JTable cells  RSS feed

 
Ajay Patel
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
i am working on an applet which contains a JTable. I want to render colors to certain cells of this table to show relation between the cells. I cannot find any method of the JTable class which helps me to specify colors individually for selected cells.
Can anybody help... thanx
AJ
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to create your own cell renderer. DefaultTableCellRenderer is the class you want to look at. Here is a site with examples Swing Examples

[This message has been edited by Paul Stevens (edited June 18, 2001).]
 
Ajay Patel
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx paul. the site was of great help.
AJ
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!