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 ?
`

Recommended Answers

All 2 Replies

test1 this is my user interface

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.