Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void processLogin() {
- password = User.encryptPassword(new String(passwordField.getPassword()));
- if(usernameField.getText().isEmpty()) {
- JOptionPane.showMessageDialog(innerPanel, "Du må oppgi et brukernavn.", "Feil", JOptionPane.ERROR_MESSAGE, iconset.getLargeErrorIcon());
- } else {
- Thread t = new Thread() {
- public void run() {
- // do stuffz
- DataLoader.showProgress(innerPanel, "Verifiserer data...");
- try {
- user = User.loadUser(usernameField.getText(), User.encryptPassword(new String(passwordField.getPassword())));
- } catch (Exception e) {
- e.printStackTrace();
- }
- DataLoader.hideProgress(innerPanel);
- if(user == null) {
- JOptionPane.showMessageDialog(innerPanel, "Oppgitt brukernavn eksisterer ikke.", "Feil", JOptionPane.ERROR_MESSAGE, iconset.getLargeErrorIcon());
- } else {
- if (passwordField.getPassword().length == 0) {
- JOptionPane.showMessageDialog(innerPanel, "Du må oppgi et passsord.", "Feil", JOptionPane.ERROR_MESSAGE, iconset.getLargeErrorIcon());
- } else if(!user.isPasswordOK()) {
- JOptionPane.showMessageDialog(innerPanel, "Ugyldig passord.", "Feil", JOptionPane.ERROR_MESSAGE, iconset.getLargeErrorIcon());
- } else {
- Launcher.closeLauncher();
- new StartFrame(user);
- }
- }
- }
- };
- t.start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement