title: Swing: process JFileChooser result after action?
body: <p>I want to use an Abstract action for JFileChooser buttons because there will be dozens of these.</p>
  
  <pre><code>public class OpenFileAction extends AbstractAction {
  JFrame frame;
  JFileChooser chooser;
  
  OpenFileAction(JFrame frame, JFileChooser chooser) {
      super("Open...");
      this.chooser = chooser;
      this.frame = frame;
  }
  
  public void actionPerformed(ActionEvent evt) {
      // Show dialog; this method does not return until dialog is closed
      chooser.showOpenDialog(frame);
  }
  };
  </code></pre>
  
  <p>Obviously I want to write the JFileChooser result to a variable. How can I access e.getSource() AFTER the action is finished? This does not work because it is triggered before the FileChooser Dialog opens:</p>
  
  <pre><code>    JButton btnNewButton_1 = new JButton(new OpenFileAction(new JFrame(), new JFileChooser(new File(".")) ) );
      btnNewButton_1.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {
              //process e.getSource() ?
          }
      });
  </code></pre>