| Author |
Changing the progress color based on value
|
Chiranjeevi Kanthraj
Ranch Hand
Joined: Feb 18, 2008
Posts: 283
|
|
Hi all
i have a table where in one coloumn i have to fill the value example 50% and the cell background color should be green till the 50% of the Cell
i think you got what i want.
so i thought of putting the JProgress bar in the renderrer of the table cell, but problem is how to change the color of the progress
for example till
60% it should be green
61%-80% Orange
more then 81%- Red
like this.
This idea is correct?
if yes how to change the color of the progress bar. i have tried googling. but that logic will change the color of all the ProgressBar in the Application.
if this idea will not work, which i can try?
Thanks in advance
|
-Chiru
|
 |
Darryl Burke
Bartender
Joined: May 03, 2008
Posts: 4163
|
|
Conditionally set the foreground in the getTableCellRendererComponent method. Don't forget to include all possible conditions to that the foreground is set to the desired color every time the method is invoked.
|
luck, db
There are no new questions, but there may be new answers.
|
 |
Chiranjeevi Kanthraj
Ranch Hand
Joined: Feb 18, 2008
Posts: 283
|
|
|
But according the forground we have to change the string color also.. can we do that?
|
 |
 |
|
|
subject: Changing the progress color based on value
|
|
|