title: Change a JPanel dynamically based on JRadioButton
body: <p>I'm trying to change content dynamically based on a JRadioButton selection...  My <b>simplified</b> code looks something like this.</p>
  
  <pre><code>//import
  public class Thing {
    //
    JPanel pnlMain, pnl1, pnl2, pnlRt, pnlLt;
    JRadioBtn btn1, btn2;
    //
    Thing () {
      //
      //initialize panels, add to them, etc.
      pnlMain.add(pnlLt);
      pnlMain.add(pnl1);
      pnlMain.add(pnlRt);
      //
      //Get it showing and stuff.
      //
      }
    //
    //One instance of this class connected to all radio buttons.
    class Evt implements ActionListener {
      public void actionImplemented (ActionEvent evt) {
        //
        pnlMain.remove(1);
        //
        if (evt.getActionCommand().equals("Radio 1"))
          pnlMain.add(pnl1);
        else pnlMain.add(pnl2);
        //
        pnlMain.validate();
        //
        }
      }
    //
    public static void main (String[] args) {
      new Thing();
      }
    //
    }
  </code></pre>
  
  <p>This lets me change panels, but i cannot change back to a panel i had previously selected...  I don't understand why.  Please help!!!</p>