title: NetBeans FileChooser. How do I use it to copy a file from one location to another defined in a string?
body: <p>I know how to perform simple operations with FileChooser within netbeans but when it comes to more complex ones, I'm getting a little stuck. So far I'm able to make use of a picture attained from the user's file system on the JFrame as below:
  But I don't know how to use it to copy a file from one location to another defined in a string?</p>
  
  <p>code:</p>
  
  <pre><code>private void ImageAtattchActionPerformed(java.awt.event.ActionEvent evt) {
      int o = jFileChooser1.showOpenDialog(this);
      if (o == JFileChooser.APPROVE_OPTION) {
          File f = jFileChooser1.getSelectedFile();
          jLabel1.setIcon(new ImageIcon("" + f));
      }
  </code></pre>