private void SubmitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SubmitButtonActionPerformed
        boolean loginflag = false;
        successMessageLabel.setText("");
        try {
            Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE", "system", "oracle");
            Statement s = con.createStatement();
            ResultSet rs = s.executeQuery("select username,password,user_index from airline_user");
            String username = UsernameTextField.getText();
            String password = PasswordField.getText();
            if (username.equals("") || password.equals("")) {
                successMessageLabel.setText("All fields are mandatory!");
                con.close();
                return;
            }

            while (rs.next()) {
                if (rs.getString(1).equals(username) && rs.getString(2).equals(password)) {

                    if (rs.getString(1).equals("admin") && rs.getString(2).equals("admin")) {
                        java.awt.CardLayout cardLayout = (java.awt.CardLayout) (SwitchPanel.getLayout());
                        cardLayout.show(SwitchPanel, "card3");
                        HelloNameLabel1.setText("Hello, " + username + "!");
                        userID = rs.getInt(3);
                    } else {
                        java.awt.CardLayout cardLayout = (java.awt.CardLayout) (SwitchPanel.getLayout());
                        cardLayout.show(SwitchPanel, "card2");
                        HelloNameLabel.setText("Hello, " + username + "!");
                        userID = rs.getInt(3);
                    }

                    loginflag = true;
                    con.close();
                    return;

                }
            }
            if (!loginflag) {
                successMessageLabel.setText("Invalid username or password");

            }
        } catch (SQLException se) {
            System.out.println(se);
        }
    }//GEN-LAST:event_SubmitButtonActionPerformed