• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12. SWT Tables > Setting the Background of a Single Cell

12.7. Setting the Background of a Single Cell

It's also possible to set the background color for only a single cell in a column. This technique is useful for highlighting cells when they contain certain values (such as number ranges).

12.7.1. How do I do that?

To change the background color of a single cell only, use a version of setBackground( ) that accepts a new parameter in the first position. This int value specifies the zero-indexed number of the column that will receive the new background:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint