You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Giguère, Philippe <Ph...@finances.gouv.qc.ca> on 2010/07/08 15:50:17 UTC

row background color in a tableView

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 ...

Re: row background color in a tableView

Posted by Greg Brown <gk...@mac.com>.
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 ...