private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
       javax.swing.JFileChooser jFileChooser1 = new javax.swing.JFileChooser(); 
       int rVal = jFileChooser1.showSaveDialog(this);
       
       String path;
      if (rVal == jFileChooser1.APPROVE_OPTION) {
           path = jFileChooser1.getCurrentDirectory().toString();
           path += "\\";
           path += jFileChooser1.getSelectedFile().getName();
           if(!path.substring(path.length()-4, path.length()).equals(".txt") && !path.substring(path.length()-4, path.length()-3).equals("."))
           {
               path += ".txt";
               //System.out.println(path.substring(path.length()-4, path.length()-3));
           }else
           {
               //System.out.println(path.substring(path.length()-4, path.length()));
           }
//           System.out.println("The Path is: " + path);
           writeToFile(path);
      }
      if (rVal == jFileChooser1.CANCEL_OPTION) {
          this.setVisible(true);
      }
    }//GEN-LAST:event_jButton3ActionPerformed