title: Graphics: How would you draw graphics on a second GUI that is opened by JButton?
body: <p>Here is what I have. Please excuse my ignorance and lack of convention.
  I am able to get a GUI open when clicking on the JButton; however, I cannot figure out — or find information — on how to draw graphics onto the GUI opened by the JButton.</p>
  
  <pre><code>@SuppressWarnings("serial")
  public class Window extends JFrame {
  
      JFrame startGUI;
      JButton startButton;
      JPanel initialPanel;
      JLabel startButtonLabel;
  
  
      public Window() {
  
          startButton = new JButton();
          initialPanel = new JPanel();
          startButtonLabel = new JLabel("Start");
  
          startButton.addActionListener(new StartButtonListener());
  
  
          add(initialPanel, BorderLayout.SOUTH);
          initialPanel.add(startButton);
          startButton.add(startButtonLabel);
  
  
  
  
          setSize(800, 600);
          setLocationRelativeTo(null);
          setUndecorated(true);
          setVisible(true);
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          }
  
      class StartButtonListener implements ActionListener {
  
          @Override
          public void actionPerformed(ActionEvent e) {
  
              startButton.isSelected();
  
              JFrame frame2 = new JFrame();
              setVisible(false);
              frame2.setSize(800, 600);
              frame2.setLocationRelativeTo(null);
              frame2.setUndecorated(true);
              frame2.setVisible(true);
              frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              }
  
          public void paint (Graphics g) {
  
              ImageIcon panel2 = new ImageIcon ("NOWNEW2.png");
              g.drawImage(panel2.getImage(), 0, 0, null);
              }
          }
  
      public void paint (Graphics g) {
  
          ImageIcon panel = new ImageIcon ("NOWNEW2.png");
          g.drawImage(panel.getImage(), 0, 0, null);
  
          try {
  
              File sound = new File("bensound-newdawn.wav");
              AudioInputStream ais = AudioSystem.getAudioInputStream(sound);
              Clip clip = AudioSystem.getClip();
              clip.open(ais);
              clip.start();
              }
  
          catch (Exception e) {
              System.out.println(e);
              }
          }
  
      public static void main (String [] args) {
          new Window();
      }
  }
  </code></pre>