2 Replies Latest reply: Apr 10, 2013 6:05 AM by gimbal2 RSS

    [ASK] Temporary Fingerprint Scanner Save File

      Hi all
      i have a problem with my project to pass the graduation..
      i try to make a attendance fingerprint system..

      my problem is when i scan my fingerprint and save my fingerprint template.. and then i close my netbeans...
      the save file is not save, being deleted... and i must scan my fingerprint again if i want to verification them..

      anyone can help my problem..


      --- Here The code ---
      private void onSave() {
                JFileChooser chooser = new JFileChooser();
                chooser.addChoosableFileFilter(new TemplateFileFilter());
                while (true) {
                     if (chooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) {
                          try {
                               File file = chooser.getSelectedFile();
                               if (!file.toString().toLowerCase().endsWith(".fpt"))
                                    file = new File(file.toString() + ".fpt");
                                                     // file=file.toString()+".fpt";
                               if (file.exists()) {
                                    int choice = JOptionPane.showConfirmDialog(this,
                                         String.format("File \"%1$s\" sudah ada.\nApakah mau mengganti?", file.toString()),
                                         "Penyimpanan Sidik Jari",
                                    if (choice == JOptionPane.NO_OPTION)
                                    else if (choice == JOptionPane.CANCEL_OPTION)
                               FileOutputStream stream = new FileOutputStream(file);
                          } catch (Exception ex) {
                               JOptionPane.showMessageDialog(this, ex.getLocalizedMessage(), "Penyimpanan Sidik Jari", JOptionPane.ERROR_MESSAGE);
      Edited by: 999185 on Apr 10, 2013 2:59 AM