title: How to set Filepicker in java swing to select only specific file ? eg . only files with .mo as extension
body: <p>The file needs to be the input file for the tool to process it further. </p>
  
  <p>I'm new to java.. would aprreciate any help.</p>
  
  <p>Here's my current code I have for the filepicker. </p>
  
  <pre><code>private void browseButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                              
          // TODO add your handling code here:
          JFileChooser chooser = new JFileChooser();
        chooser.showOpenDialog(null);
        File f = chooser.getSelectedFile();
        String filename = f.getAbsolutePath();
        textField1.setText(filename);
      }                                   
  </code></pre>