|
|
@ -74,9 +74,11 @@ public class LoginFrame extends JFrame implements ActionListener, KeyListener { |
|
|
|
contentPane.add(loginHauptImage); |
|
|
|
|
|
|
|
this.anmelden.addActionListener(this); |
|
|
|
this.anmelden.addKeyListener(this); |
|
|
|
passwordField.addActionListener(this); |
|
|
|
benutzername.addActionListener(this); |
|
|
|
this.anmelden.addKeyListener(this); |
|
|
|
benutzername.addKeyListener(this); |
|
|
|
passwordField.addKeyListener(this); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -107,17 +109,20 @@ public class LoginFrame extends JFrame implements ActionListener, KeyListener { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void keyTyped(KeyEvent e) { |
|
|
|
|
|
|
|
if (e.getSource() == this.anmelden) { |
|
|
|
MeinGui run = new MeinGui(); |
|
|
|
run.setVisible(true); |
|
|
|
} |
|
|
|
// TODO Auto-generated method stub |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void keyPressed(KeyEvent e) { |
|
|
|
// TODO Auto-generated method stub |
|
|
|
|
|
|
|
if (e.getKeyCode() == KeyEvent.VK_ENTER) { |
|
|
|
if (benutzername.getText().length() > 0 && passwordField.getText().length() > 0) { |
|
|
|
MeinGui run = new MeinGui(); |
|
|
|
run.setVisible(true); |
|
|
|
} else { |
|
|
|
JOptionPane.showMessageDialog(this.anmelden, "Bitte geben Sie die richtigen Daten ein!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|