You'll need to write a custom renderer to do this. TableView by itself does not
support setting a background color for individual rows.
On Jul 8, 2010, at 9:50 AM, Giguère, Philippe wrote:
> Hi,
>
> I can't change the background of a single cell or a whole row in a TableView.
> I can change the background color of a column with a renderer. When I creat
> new a TableViewCellRenderer and use the render method
> (rend.render(issueTableData.get(1), 1, 2, issueTableView, "key", true, true,
> false);), I see that I'm in the good cell because getText() returns the good
> string.
>
> I set the background like this :
> rend.getStyles().put("backgroundColor","#FF6666");
>
> How I set this background color to single cell or row ? I used setEnable,
> setVisible, repaint … but the background never changed.
>
> Thx a lot
>
> Phil
> Avis de confidentialité: Ce courriel et les pièces qui y sont jointes peuvent
> contenir des renseignements confidentiels qui ne vous sont pas destinés. Si
> vous avez reçu cette correspondance par erreur, veuillez la détruire et nous
> en aviser. Merci!
>
> Devez-vous vraiment imprimer ce courriel ? Pensons à l'environnement ...