title: how to backup file in java?
body: <p>In reality its just making a copy of a text.txt file. I know how to use file chooser to choose the file but that is as far as my knowledge really goes. </p>
  
  <p>I can do this:</p>
  
  <pre><code>public BasicFile()
  {
     JFileChooser choose = new JFileChooser(".");
     int status = choose.showOpenDialog(null);
  
     try
     {
          if (status != JFileChooser.APPROVE_OPTION) throw new IOException();
  
          f = choose.getSelectedFile();
  
          if (!f.exists()) throw new FileNotFoundException();
     }
     catch(FileNotFoundException e)
     {
          display(1, e.toString(), "File not found ....");
     }
     catch(IOException e)
     {
          display(1, e.toString(),  "Approve option was not selected");
     }
  
  }
  </code></pre>