0

hey all
i have a table in my project which called tasktable it retrives data from database (oracle) how can i change the color of the row that has the color in the cell ex. (i,8) Automatically when i click in refresh butomn

i have tried so many times to put that source code on specifec row but it ended up coloring all the table

`

                     int count;      
                     count = tasktable.getRowCount();
             for (int i=0;i<count;i++)
                { 
                      rr = new Object ();
                       rr = tasktable.getModel().getValueAt(i,8);




                       if(rr.equals("GREEN"))
                       {
                     setBackground(Color.GREEN);
                       }

                        if(rr.equals("red"))
                       {

                           setBackground(Color.red);

                       }
                         if(rr.equals("BLUE"))
                       {

                          setBackground(Color.BLUE);

                       }
                          if(rr.equals("yellow"))
                       {

                         setBackground(Color.yellow);

                       }
                           if(rr.equals("pink"))
                       {

                         setBackground(Color.pink);

                       }
                           if(rr.equals(null))
                       {
                         setBackground(null);


                       }

how can help me out upon this problem ?
`

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by JamesCherrill
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.