Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable row selection

 
Derrick Albers
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTable that by default highlights the selected row when clicked, this works for my but I wanted to change the color of the font for a column. I created a TableCellRenderer for this and it works, the problem is that now when you select the row everything is highlight except for the cell that has a custome Renderer. How can I listen and change that cell with the row?

The is the render class:
 
Darryl Burke
Bartender
Posts: 5126
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To get better help sooner, post a SSCCE (Short, Self Contained, Compilable and Executable) example that demonstrates the problem.

edit Also note that for such trivial customization, you might as well extend DefaultTableCellRenderer.
 
Derrick Albers
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was able to fix by wrapping the value for that cell in <html> and set the font color and <u> to underline it without needing to change the Renderer.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic