Exemple #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
Exemple #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
Exemple #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
Exemple #4
0
 private void passwordTextBoxKeyPressed(
     java.awt.event.KeyEvent evt) { // GEN-FIRST:event_passwordTextBoxKeyPressed
   // TODO add your handling code here:
   int key = evt.getKeyCode();
   if (key == KeyEvent.VK_ENTER) {
     boolean verify = false;
     String user = usernameTextBox.getText();
     String passwd = passwordTextBox.getText();
     if (user.equals("") || passwd.equals("")) {
       JOptionPane.showMessageDialog(
           AdminLogin.this, "Sorry! You must enter a Username and Password to login ");
       usernameTextBox.requestFocus();
     } else {
       Connection con = getConnection();
       try {
         ResultSet rows;
         Statement s =
             con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
         String select = "Select * from admin;";
         rows = s.executeQuery(select);
         while (rows.next()) {
           String username = rows.getString("Username");
           String password = rows.getString("Password");
           if (user.equals(username) && passwd.equals(password)) {
             verify = true;
             this.dispose();
             //                       btn.btnEnabled();
             break;
           }
         }
         if (verify == false) {
           verify = false;
           JOptionPane.showMessageDialog(
               AdminLogin.this, "Access Denied! Invalid Username or Password");
           usernameTextBox.setText("");
           passwordTextBox.setText("");
           usernameTextBox.requestFocus();
         }
       } catch (SQLException e) {
         System.out.println(e.getMessage());
       }
       if (verify == false) {
         JOptionPane.showMessageDialog(
             AdminLogin.this, "Access Denied!  Invalid Username or Password");
         usernameTextBox.setText("");
         passwordTextBox.setText("");
         usernameTextBox.requestFocus();
       } // TODO add your handling code here:
     }
   }
   if (key == KeyEvent.VK_UP) {
     usernameTextBox.grabFocus();
   }
   if (key == KeyEvent.VK_KP_UP) {
     usernameTextBox.grabFocus();
   }
 } // GEN-LAST:event_passwordTextBoxKeyPressed
Exemple #5
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
Exemple #6
0
 private void btnIngresarKeyPressed(
     java.awt.event.KeyEvent evt) { // GEN-FIRST:event_btnIngresarKeyPressed
   // TODO add your handling code here:
   char car = (char) evt.getKeyCode();
   if (car == evt.VK_ENTER) {
     this.hide();
     // Principal prin = new Principal();
     // prin.show();
     String usu = txtusuario.getText();
     String pas = new String(txtcontra.getPassword());
     acceder(usu, pas);
   }
 } // GEN-LAST:event_btnIngresarKeyPressed
Exemple #7
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
Exemple #8
0
 private void txtKasirKeyPressed(
     java.awt.event.KeyEvent evt) { // GEN-FIRST:event_txtKasirKeyPressed
   if (evt.getKeyCode() == evt.VK_ENTER) {
     txtPass.requestFocusInWindow();
   }
 } // GEN-LAST:event_txtKasirKeyPressed