|
@ -22,8 +22,8 @@ import java.awt.Color; |
|
|
public class LoginFrame extends JFrame implements ActionListener { |
|
|
public class LoginFrame extends JFrame implements ActionListener { |
|
|
|
|
|
|
|
|
public JPanel contentPane; |
|
|
public JPanel contentPane; |
|
|
public JPasswordField passwordField; |
|
|
|
|
|
public JTextField textField; |
|
|
|
|
|
|
|
|
public static JPasswordField passwordField; |
|
|
|
|
|
public static JTextField benutzername; |
|
|
public JButton anmelden; |
|
|
public JButton anmelden; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -64,10 +64,10 @@ public class LoginFrame extends JFrame implements ActionListener { |
|
|
passwordField.setBounds(147, 137, 132, 20); |
|
|
passwordField.setBounds(147, 137, 132, 20); |
|
|
contentPane.add(passwordField); |
|
|
contentPane.add(passwordField); |
|
|
|
|
|
|
|
|
textField = new JTextField(); |
|
|
|
|
|
textField.setBounds(147, 106, 132, 20); |
|
|
|
|
|
contentPane.add(textField); |
|
|
|
|
|
textField.setColumns(10); |
|
|
|
|
|
|
|
|
benutzername = new JTextField(); |
|
|
|
|
|
benutzername.setBounds(147, 106, 132, 20); |
|
|
|
|
|
contentPane.add(benutzername); |
|
|
|
|
|
benutzername.setColumns(10); |
|
|
|
|
|
|
|
|
JLabel labaelBenutzername = new JLabel("Benutzername:"); |
|
|
JLabel labaelBenutzername = new JLabel("Benutzername:"); |
|
|
labaelBenutzername.setBounds(48, 106, 89, 20); |
|
|
labaelBenutzername.setBounds(48, 106, 89, 20); |
|
@ -93,16 +93,20 @@ public class LoginFrame extends JFrame implements ActionListener { |
|
|
|
|
|
|
|
|
this.anmelden.addActionListener(this); |
|
|
this.anmelden.addActionListener(this); |
|
|
this.passwordField.addActionListener(this); |
|
|
this.passwordField.addActionListener(this); |
|
|
this.textField.addActionListener(this); |
|
|
|
|
|
|
|
|
this.benutzername.addActionListener(this); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void actionPerformed(ActionEvent ae) { |
|
|
public void actionPerformed(ActionEvent ae) { |
|
|
|
|
|
|
|
|
if (ae.getSource() == this.anmelden |
|
|
if (ae.getSource() == this.anmelden |
|
|
&& (this.textField.getText().length() == 0 || this.passwordField.getText().length() == 0)) { |
|
|
|
|
|
|
|
|
&& (benutzername.getText().length() == 0 || passwordField.getText().length() == 0)) { |
|
|
JOptionPane.showMessageDialog(anmelden, "Bitte geben Sie die richtigen Daten ein!"); |
|
|
JOptionPane.showMessageDialog(anmelden, "Bitte geben Sie die richtigen Daten ein!"); |
|
|
System.out.println("Dah"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static String setBenutzername() { |
|
|
|
|
|
String result = String.valueOf(benutzername); |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
} |
|
|
} |