title: Using FileFilter in Netbeans
body: <p>I'm using this tutorial to add a File Chooser in a Netbeans project:
  <a href="https://netbeans.org/kb/docs/java/gui-filechooser.html" rel="nofollow">https://netbeans.org/kb/docs/java/gui-filechooser.html</a></p>
  
  <p>I'm not using the project that they set up, but have followed the File Chooser part of the tutorial exactly as written.</p>
  
  <p>I just can't get the FileFilter to work though.  I get the following error on this line in initComponents() :</p>
  
  <pre><code>FileChooser.setFileFilter(MyCustomFilter());
  </code></pre>
  
  <p>It throws the error: </p>
  
  <blockquote>
    <p>error: cannot find symbol
            FileChooser.setFileFilter(MyCustomFilter());   symbol:   method MyCustomFilter()   location: class frmMain</p>
  </blockquote>
  
  <p>I have tried placing the code for the MyCustomFilter class under the imports at the top (as suggested in the tutorial) and at various other points in the code, but with no success.</p>
  
  <p>Where exactly should this code go?  Any other reasons why I am getting this error?  To reiterate, I am following the tutorial from the "Adding the File Chooser" section downwards and copying and pasting the code.</p>