Browse Source

Commit_42 (Bugfix) KeyListener in LoginFrame_Class hinzugefuegt. Enter_Key bei Anmelden

Mohamed
Adah Boukhari 5 years ago
parent
commit
6e1f2eb3c5
  1. BIN
      Budget Projekt/bin/MeinBudgetView/LoginFrame.class
  2. 19
      Budget Projekt/src/MeinBudgetView/LoginFrame.java

BIN
Budget Projekt/bin/MeinBudgetView/LoginFrame.class

19
Budget Projekt/src/MeinBudgetView/LoginFrame.java

@ -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

Loading…
Cancel
Save