title: how to save java swing ImageIcon image to file?
body: <p>I am using the following code for displaying the Image on the swing frame.</p>
  
  <pre><code>ImageIcon icon = new ImageIcon("image.jpeg");
  icon.getImage().flush();
  jLabel3.setIcon( icon );
  </code></pre>
  
  <p>I need a button which when clicked upon will save the image with a jpeg/png extension .</p>