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(); }
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
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
/* * 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
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
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