Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes Changing color in particular row Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Changing color in particular row" Watch "Changing color in particular row" New topic
Author

Changing color in particular row

Andy Wong
Greenhorn

Joined: Jun 13, 2002
Posts: 3
Guys,
I would like to highlight (by changing color or font) in a particular row/cell (not column). How do I implement it? I have tried List Selection, but it is not the case; I just want change the appearance, not affect the users' selection. Please advise.
Regards,
Rene Liebmann
Ranch Hand

Joined: May 02, 2002
Posts: 196
Hi,
this topic was discussed many times before. Please use the search for finding something about it. I tried the keywords "Row Color".
Just a hint, you have to write your own TableCellRenderer. Mostly you can extend from DefaultTableCellRenderer. There you need to implement one function getTableCellRendererComponent.
Bye
Rene
 
wood burning stoves
 
subject: Changing color in particular row
 
Similar Threads
changing color of one row dynamically
JTable
table row selection in Netscape
Setting focus to a table row
How to change the color of the row(JTable) when mouse move over it?