Пример #1
0
  private void jBMostrarTodosKeyTyped(
      java.awt.event.KeyEvent evt) { // GEN-FIRST:event_jBMostrarTodosKeyTyped

    if (evt.getKeyChar() == KeyEvent.VK_ENTER) {
      if (evt.getSource() == jBMostrarTodos) {
        jTFPesquisar.setText("");
        jBPesquisar.doClick();
      }
    }
  } // GEN-LAST:event_jBMostrarTodosKeyTyped
Пример #2
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
Пример #3
0
  private void tabelaKeyTyped(java.awt.event.KeyEvent evt) { // GEN-FIRST:event_tabelaKeyTyped

    if (evt.getKeyChar() == KeyEvent.VK_ENTER) {
      if (evt.getSource() == tabela) {

        int indice = tabela.getSelectedRow();
        if (indice != -1) {

          JobLote dados = modelo.getJob(tabela.convertRowIndexToModel(tabela.getSelectedRow()));
          timerTelaExclusao.stop();
          ExclusaoLoteView tela =
              new ExclusaoLoteView(null, true, dados, timerTelaExclusao, jBAtualizar);
          tela.setVisible(true);
        }
      }
    }
  } // GEN-LAST:event_tabelaKeyTyped
Пример #4
0
  private void jBPesquisarKeyTyped(
      java.awt.event.KeyEvent evt) { // GEN-FIRST:event_jBPesquisarKeyTyped

    if (evt.getKeyChar() == KeyEvent.VK_ENTER) {
      if (evt.getSource() == jBPesquisar) {

        String text = jTFPesquisar.getText();
        if (text.length() == 0) {
          sorter.setRowFilter(null);
        } else {
          try {
            sorter.setRowFilter(RowFilter.regexFilter(text));
          } catch (PatternSyntaxException pse) {
            JOptionPane.showMessageDialog(this, "Erro na pesquisa");
          } catch (RuntimeException ex2) {
            JOptionPane.showMessageDialog(null, "Erro: " + ex2.getMessage());
          }
        }
      }
    }
  } // GEN-LAST:event_jBPesquisarKeyTyped
Пример #5
0
 private void manualInputKeyTyped(
     java.awt.event.KeyEvent evt) { // GEN-FIRST:event_manualInputKeyTyped
   // TODO add your handling code here:
   String strId = manualInput.getText();
   // System.out.println(evt.getKeyCode());
   if (evt.getKeyChar() == '\n') {
     if (isId(strId)) {
       int id = getId();
       if (isIdFound(id)) {
         int personId = getPersonId(id);
         if (!isLoggedIn(id)) {
           logIn(personId);
           manualInput.setText("");
         } else {
           logOut(personId);
           manualInput.setText("");
         }
       }
     }
   }
 } // GEN-LAST:event_manualInputKeyTyped