title: Is there a way to save my bufferedImage with the extention selected in my JfileChooser?
body: <p>i got a problem with my code. First of all, i created a JfileChooser, to save my bufferedImage into a file.
  The problem is when i save it, if i don't write the extension in the window it will be a normal file instead of a jpg/png or other.. How can i do that?</p>
  
  <p>I tryed some weird code like getting the description of fileextension but it doesn't work</p>
  
  <pre><code>    JFileChooser savechooser = new JFileChooser();
      savechooser.setFileFilter(new FileNameExtensionFilter("JPEG File", "jpg"));
      savechooser.setFileFilter(new FileNameExtensionFilter("PNG File", "png"));
      savechooser.setFileFilter(new FileNameExtensionFilter("GIF File", "gif"));
      int returnVal = savechooser.showSaveDialog(null);
      if(returnVal == JFileChooser.APPROVE_OPTION) {
          ImageIO.write(bImage, "png" , new File(savechooser.getSelectedFile().getAbsolutePath()));
  </code></pre>
  
  <p>I expect a "test.png" or "test.jpeg", but the actual output would be a "test" file..</p>