title: Filter file types with JFileChooser
body: <p>I am using JFileChooser to select a file and I am trying to limit the display to show only jpg or jpeg files.  I have tried FileFilter and ChoosableFileFilter and it is not limiting the file selection.  Here is my code:</p>
  
  <pre><code>JFileChooser chooser = new JFileChooser();
  FileFilter filter = new FileNameExtensionFilter("JPEG file", new String[] {"jpg", "jpeg"});
  chooser.setFileFilter(filter);
  chooser.addChoosableFileFilter(filter);
  int returnVal = chooser.showOpenDialog(null);
  if(returnVal == JFileChooser.APPROVE_OPTION) {
    debug.put("You chose to open this file: " + chooser.getSelectedFile().getAbsolutePath());
    File selectedFile = new File(chooser.getSelectedFile().getAbsolutePath());
  ...
  </code></pre>