title: Adding an image in jpanel inside of a action listener
body: <p>Hello again ladies and gentlemen, 
  I have once again not been able to figure out something that to you will probably be simple.
  I am trying to load 3 images space.jpeg, treefrog.jpeg and yosemite.jpeg (As you click a radio button that the corresponding image is displayed) and have tried adapting every example I can find. If any one wants to point me in the right direction I would greatly appreciate it.</p>
  
  <pre><code>package guiprogramming;
  import java.awt.*;
  import javax.swing.*;
  import javax.swing.border.*;
  import java.awt.event.*;
  
  public class ChooseImage extends JPanel {
     private JPanel panel1;
     private SimplePanel drawingPanel;
     JRadioButton button1, button2, button3;
  
  public ChooseImage() {
     setLayout(new BorderLayout());
     panel1 = new JPanel();
     drawingPanel = new SimplePanel();
     button1 = new JRadioButton("Scenery");
     panel1.add(button1);
     button2 = new JRadioButton("Space");
     panel1.add(button2);
     button3 = new JRadioButton("Tree Frog");
     panel1.add(button3);
  
     ButtonGroup group = new ButtonGroup();
      group.add(button1);
      group.add(button2);
      group.add(button2);
  
    this.add(panel1, BorderLayout.NORTH);
    this.add(drawingPanel, BorderLayout.CENTER);
  
  
    button1.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent e) {
       //This is where I am trying to get the images to load
       }});
  
    button2.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
       //This is where I am trying to get the images to load
       }});
  
    button3.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
      //This is where I am trying to get the images to load
      }});
  
  
  
  
  
  
  
  
    }
  
    public static void main(String[] args) {
    JFrame window = new JFrame("Choose Image");
    ChooseImage panel = new ChooseImage();
    window.setContentPane(panel);
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    window.setSize(500, 500);
    window.setVisible(true);
    }
    }
  </code></pre>