title: Opening files with JFileChooser
body: <p>As a little side project I'd thought it would cool to make a text editor. I'm currently stuck on opening files. This is my code for opening the file(<code>e</code> is an <code>ActionEvent</code>, open is a <code>JMenuItem</code>):</p>
  
  <pre><code>else if (e.getSource() == open) {
          JFileChooser choice = new JFileChooser();
          int option = choice.showOpenDialog(this);
          if (option == JFileChooser.APPROVE_OPTION) {
              try{
                  Scanner scan = new Scanner(new FileReader((open).getSelectedFile().getPath()));
              }
          }
  
      }
  </code></pre>
  
  <p>The try block is giving me the trouble. Eclipse is saying that <code>getSelectedFile()</code> is undefined for type <code>JMenuItem</code>. It also appears to be undefined for <code>MenuItem</code>s as well. Is there another way to approach this, or another method that works the same?</p>