title: The method showSaveDialog(Component) in the type JFileChooser is not applicable for ()
body: <p>I want to initialize a frame, with a saveDialog, however when using this <code>chooser.showSaveDialog(this);</code> I get an error:</p>
  
  <pre><code>public void initialize() {
  
      JFrame frame = new JFrame();
      Container content = frame.getContentPane();
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
      //Menu
      JMenu menu = new JMenu("File");
      menu.add(new AbstractAction("Make Image") {
          public void actionPerformed(ActionEvent e) {
              JFileChooser chooser  = new JFileChooser();
              int option = chooser.showSaveDialog(this);
              if(option == JFileChooser.APPROVE_OPTION) {
                  File file = chooser.getSelectedFile();
                  writeJPEGImage(file);
              }
          }});
  
      JPopupMenu.setDefaultLightWeightPopupEnabled(false);
      JMenuBar menuBar = new JMenuBar();
      menuBar.add(menu);
      frame.setJMenuBar(menuBar);
  
  
      content.add(tree);
      frame.pack();
      frame.setVisible(true);
  }
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <blockquote>
    <p>The method showSaveDialog(Component) in the type JFileChooser is not
    applicable for the arguments ()</p>
  </blockquote>
  
  <p>I know that this methods usually gets a Component, but I do not have any in my class, cause I am loading it in this method.</p>
  
  <p>Any recommendations how to fix that?</p>
  
  <p>I appreciate your answer!</p>
  
  <p><strong>PS.:</strong> <code>new Test()</code> does work, but I have to give it the current component!</p>