예제 #1
0
  public void atualizacaoAutomaticaTabela() {

    ActionListener acao =
        new ActionListener() {

          @Override
          public void actionPerformed(ActionEvent ae) {

            final Progress p = new Progress();
            p.setVisible(true);
            SwingWorker worker =
                new SwingWorker() {

                  @Override
                  protected Object doInBackground() throws Exception {
                    atualizaTabela();
                    return null;
                  }

                  @Override
                  protected void done() {
                    p.setVisible(false);
                  }
                };
            worker.execute();
          }
        };
    timerTelaExclusao = new Timer(5000 * 60, acao); // a cada 5 minutos executa o metodo
    timerTelaExclusao.start();
  }
예제 #2
0
 private void jBFecharActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jBFecharActionPerformed
   // TODO add your handling code here:
   this.setVisible(false);
   timerPCP.start();
   timer.stop();
 } // GEN-LAST:event_jBFecharActionPerformed
예제 #3
0
  private void jBFecharActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jBFecharActionPerformed

    timerTelaExclusao.stop();
    timer.start();
    this.setVisible(false);
    atualizar.doClick();
  } // GEN-LAST:event_jBFecharActionPerformed
예제 #4
0
  /*
   * executado ao clicar no botao excluir
   */
  private void jBExcluirLoteActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jBExcluirLoteActionPerformed

    timerTelaExclusao.stop();
    this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    excluir();
    this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    timerTelaExclusao.start();
    jBAtualizar.doClick();
  } // GEN-LAST:event_jBExcluirLoteActionPerformed
예제 #5
0
  private void jBFecharKeyTyped(java.awt.event.KeyEvent evt) { // GEN-FIRST:event_jBFecharKeyTyped

    if (evt.getKeyChar() == KeyEvent.VK_ENTER) {
      if (evt.getSource() == jBFechar) {
        this.setVisible(false);
        timerPCP.start();
        timer.stop();
      }
    }
  } // GEN-LAST:event_jBFecharKeyTyped
예제 #6
0
  private void jBFecharKeyTyped(java.awt.event.KeyEvent evt) { // GEN-FIRST:event_jBFecharKeyTyped

    if (evt.getKeyChar() == KeyEvent.VK_ENTER) {
      if (evt.getSource() == jBFechar) {
        timerTelaExclusao.stop();
        timer.start();
        this.setVisible(false);
        atualizar.doClick();
      }
    }
  } // GEN-LAST:event_jBFecharKeyTyped