Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Shadding rows in JTable  RSS feed

 
Ray Kumar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I wanted to shade every alternate two rows in JTable with some color (same color). Any ideas!!! sample code !!!
Thanks in advance.
 
Brian Snyder
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to set the table's cell renderer as such and set the background based on column/row. In addition to that you must override the getCellRenderer method.

Happy programming!!!
[ May 21, 2002: Message edited by: Brian Snyder 2002 ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"pk" & "Brian Snyder 2002" -

Welcome to the JavaRanch! Please adjust your displayed name to meet the
JavaRanch Naming Policy.
You can change it here.

Thanks! and welcome to the JavaRanch!

-Nate
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!