Пример #1
0
    /*
     * Main task. Executed in background thread.
     */
    @Override
    public Void doInBackground() {

      int progress = 0;
      // Initialize progress property.
      setProgress(0);
      setProgress(Math.min(progress, 100));

      try {
        Split977 sp = new Split977();
        sp.setAcuerdo(jtf.getText());
        String[] f = jtaFicheros.getText().split("\n");
        JOptionPane.showMessageDialog(frame, "Número de ficheros:" + f.length);
        sp.setFicheros(f);
        sp.setBorrarTablas(jcbBorrarTablas.isSelected());
        sp.setDetalleLlamadas(jcbDetalleLlamadas.isSelected());
        sp.setDetalleLlamadasRI(jcbDetalleLlamadasRI.isSelected());
        for (int i = 0; i < f.length; i++) {
          jtaResultado.append(f[i] + "\n");
        }

        sp.setDbHost(jtfHost.getText());
        sp.setDbName(jtfDB.getText());
        sp.setDbUser(jtfUser.getText());
        String pass = new String(jpfPass.getPassword());
        sp.setDbPass(pass);
        System.out.println(pass);

        jtaResultado.append(sp.execute());
        // JOptionPane.showConfirmDialog(frame, "Finito!");
        JOptionPane.showMessageDialog(frame, "Finito!");
      } catch (Exception e) {
        // TODO: handle exception
      }

      return null;
    }