• Post Reply Bookmark Topic Watch Topic
  • New Topic

TableCellRenderer with JLabel setBackground help  RSS feed

 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

In a specific instance I need a column of a table to look blank. So I have coded the renderer as follows...



The problem is that the foreground and text is set fine, but the background is not blue. Where can I start looking to fix this?

Many kind regards,
Rachel
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
add one more code. it should work.

------------
setOpaque(true);
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was it. Thanks for the code!

Cheers,
Rachel
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!