title: Unable to set background color of checkbox at runtime
body: <p>There is a class AgentHome which extends JFrame.
  AgentHome has  a JPanel rem_panel. Checkboxes are added dynamically into rem_panel…number of checkboxes depending on the number of entries in the database table from where the text to be displayed by the textboxes are read.</p>
  
  <p>AgentHome has an integer variable x and a checkbox arraylist rem_cbarr.</p>
  
  <p>rem_cbarr stores the checkboxes as they are created and added to rem_panel.
  I am trying to set the background color of these checkboxes to red when the variable x is set to 1 as the program executes.
  I have implemented the TickerBehaviour of JADE framework to check if the variable x is set to 1.</p>
  
  <p>I am unable to set the background color of the checkboxes to red. This is the code I have implemented. Please help. Thanks.</p>
  
  <pre><code> public void setup()
  {
    Behaviour loop = new TickerBehaviour( this, 2000 )
    {
       protected void onTick() {
  
        timer();
       }
    };
  
  
     addBehaviour( loop );
   }
  
    public void timer()
  {
      AgentHome hm=new AgentHome();
             if(hm.x==1)
         {
             for (int i = hm.rem_cbarr.size()-1; i&gt;=0; i--)
                     {
                         JCheckBox cb=hm.rem_cbarr.get(i);
                       cb.setBackground(Color.red);
                        hm.rem_panel.revalidate();
                       hm.rem_panel.repaint();
                     }
        }
  }
  </code></pre>