samedi 14 décembre 2019

How can I fix this else syntax error in java? [duplicate]

This question already has an answer here:

I have this error on else. Can anyone help me?
I'm trying to make a Login system.

JButton btnLogin = new JButton("Login");
        btnLogin.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                String password = txtPasswort.getText();
                String username = txtName.getText();
                if(password.contains("you wont see the pass lol") && username.contains("Splxsh"));
                if(password.contains("you wont see the pass lol") && username.contains("zCode"));
                txtPasswort.setText(null);
                txtName.setText(null);
                JOptionPane.showConfirmDialog(null, "Erfolgreich eingeloggt!", "Hello", JOptionPane.DEFAULT_OPTION);

        }else {//heres the error
            JOptionPane.showMessageDialog(null, "Falsche Logindaten!", "Loginfehler", JOptionPane.ERROR_MESSAGE);
            txtPasswort.setText(null);
            txtName.setText(null);
        }

Aucun commentaire:

Enregistrer un commentaire