|
@ -4,6 +4,8 @@ import java.awt.BorderLayout; |
|
|
import java.awt.EventQueue; |
|
|
import java.awt.EventQueue; |
|
|
import java.awt.Font; |
|
|
import java.awt.Font; |
|
|
import java.awt.Image; |
|
|
import java.awt.Image; |
|
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
|
|
|
|
import javax.swing.JFrame; |
|
|
import javax.swing.JFrame; |
|
|
import javax.swing.JPanel; |
|
|
import javax.swing.JPanel; |
|
@ -13,13 +15,16 @@ import javax.swing.JButton; |
|
|
import javax.swing.JPasswordField; |
|
|
import javax.swing.JPasswordField; |
|
|
import javax.swing.JTextField; |
|
|
import javax.swing.JTextField; |
|
|
import javax.swing.JLabel; |
|
|
import javax.swing.JLabel; |
|
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
|
|
|
|
|
import java.awt.Color; |
|
|
import java.awt.Color; |
|
|
|
|
|
|
|
|
public class LoginFrame extends JFrame { |
|
|
|
|
|
|
|
|
public class LoginFrame extends JFrame implements ActionListener { |
|
|
|
|
|
|
|
|
private JPanel contentPane; |
|
|
|
|
|
private JPasswordField passwordField; |
|
|
|
|
|
private JTextField textField; |
|
|
|
|
|
|
|
|
public JPanel contentPane; |
|
|
|
|
|
public JPasswordField passwordField; |
|
|
|
|
|
public JTextField textField; |
|
|
|
|
|
public JButton anmelden; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Launch the application. |
|
|
* Launch the application. |
|
@ -51,7 +56,7 @@ public class LoginFrame extends JFrame { |
|
|
setContentPane(contentPane); |
|
|
setContentPane(contentPane); |
|
|
contentPane.setLayout(null); |
|
|
contentPane.setLayout(null); |
|
|
|
|
|
|
|
|
JButton anmelden = new JButton("Anmelden"); |
|
|
|
|
|
|
|
|
anmelden = new JButton("Anmelden"); |
|
|
anmelden.setBounds(182, 168, 97, 23); |
|
|
anmelden.setBounds(182, 168, 97, 23); |
|
|
contentPane.add(anmelden); |
|
|
contentPane.add(anmelden); |
|
|
|
|
|
|
|
@ -79,7 +84,6 @@ public class LoginFrame extends JFrame { |
|
|
loginImage.setFont(new Font("Tahoma", Font.BOLD, 13)); |
|
|
loginImage.setFont(new Font("Tahoma", Font.BOLD, 13)); |
|
|
contentPane.add(loginImage); |
|
|
contentPane.add(loginImage); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JLabel loginHauptImage = new JLabel(""); |
|
|
JLabel loginHauptImage = new JLabel(""); |
|
|
loginHauptImage.setBounds(10, 11, 56, 51); |
|
|
loginHauptImage.setBounds(10, 11, 56, 51); |
|
|
Image image2 = new ImageIcon(this.getClass().getResource("/budgetapp.png")).getImage(); |
|
|
Image image2 = new ImageIcon(this.getClass().getResource("/budgetapp.png")).getImage(); |
|
@ -87,5 +91,18 @@ public class LoginFrame extends JFrame { |
|
|
loginHauptImage.setFont(new Font("Tahoma", Font.BOLD, 13)); |
|
|
loginHauptImage.setFont(new Font("Tahoma", Font.BOLD, 13)); |
|
|
contentPane.add(loginHauptImage); |
|
|
contentPane.add(loginHauptImage); |
|
|
|
|
|
|
|
|
|
|
|
this.anmelden.addActionListener(this); |
|
|
|
|
|
this.passwordField.addActionListener(this); |
|
|
|
|
|
this.textField.addActionListener(this); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void actionPerformed(ActionEvent ae) { |
|
|
|
|
|
|
|
|
|
|
|
if (ae.getSource() == this.anmelden |
|
|
|
|
|
&& (this.textField.getText().length() == 0 || this.passwordField.getText().length() == 0)) { |
|
|
|
|
|
JOptionPane.showMessageDialog(anmelden, "Bitte geben Sie die richtigen Daten ein!"); |
|
|
|
|
|
System.out.println("Dah"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |