Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

painting JTable rows

 
Tony Bouer
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm thinking about paint the rows "non-bookable" with a different color in my JTable. I tried to use a renderer but it's always based on colunms, so it's necessary to:
- identify the row to be painted
- iterate over all colunms painting the rows I want.

Is there a easier way to do that ? Any piece of code is really appreciated.
Tks,
Tony
 
Jeroen T Wenting
Ranch Hand
Posts: 1847
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


and in your JTable descendent constructors set that renderer for each column.


I know it sounds a bit weird, but it works

Of course I do have rowselection and singleselection turned on for the JTable, which may influence the rendering to render the entire row in the special color rather than just a single cell.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic