title: Dynamically change Background Image of a JPanel
body: <p>Trying ti change the BG image of a jpanel but i cant call poaint on any normal method, it works great when i'm building the constructor but i don't want to rebuild the constructor.</p>
  
  <p>....</p>
  
  <p>Sort of found a solution by putting a label in my center frame and calling setIcon but i need to be able to pull the relelevant info so i need to find a way to store a value into my Jtoggle button (the id of the Race or class so i can fetch it's picture and change the icon)</p>
  
  <p>thoughts? Everything compiles outside the iff statement which is my sticking point</p>
  
  <pre><code>RaceButtons_lft[i] =  new JToggleButton();
  RaceButtons_lft[i].addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent ae) {
  JToggleButton cb = (JToggleButton)ae.getSource();
  for (int j=0; j&lt;MyRaceArray.size(); j++)
  {
  if (MyRaceArray.get(j).getraceID() == combo_contents.getIndex()){//here is my sticking point, i need to find a way to match MyRaceArray's getRaceID to some value saved withthe Toggle button
  final ImageIcon BGCSMs = ScaledImageIcon("Fantasy_Landscape_01.jpg", "Profile Pic", (468-(60*2)), 285);
  picLabel.setIcon(BGCSMs);
  }//if
  }//for
  }//action performed;
  });//button add action listener
  </code></pre>