private void jButtonValidarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonValidarActionPerformed
        if (jTextFieldNome.getText() == null || jTextFieldNome.getText().equals("")) {
            jLabelErro.setErrorText(WORDS.getString("ERRO-CODIGO"));
        } else if (jTextFieldSenha.getPassword().length < 4) {
            jLabelErro.setErrorText(WORDS.getString("ERRO-SENHA"));
        } else {
            try {
                Integer cod = Integer.valueOf(jTextFieldNome.getText());
                userName = banco.validarUsuario(cod, jTextFieldSenha.getPassword());
                jLabelUserName.setText(userName);
                Object[][] table = banco.getEmprestimoAberto(cod);
                DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
                if (table.length > 0) {
                    model.setNumRows(0);
                    for (Object[] table1 : table) {
                        if ((Integer) table1[3] == 0) {
                            table1[3] = WORDS.getString("ABERTO");
                        } else if ((Integer) table1[3] == 1) {
                            table1[3] = WORDS.getString("PENDENTE");
                        }
                        model.addRow(table1);
                    }
                    jLabelErro.setText("");
                    inserirUsuario(false);
                } else {
                    jLabelErro.setErrorText(WORDS.getString("ERRO-SEM-EMPRESTIMOS"));
                }
            } catch (Exception ex) {
                jLabelErro.setErrorText(ex.getMessage());
            }
        }
    }//GEN-LAST:event_jButtonValidarActionPerformed