Browse Source

Commit_36 showMessageDialog implementiert

Mohamed
Adah Boukhari 4 years ago
parent
commit
cf0659d85f
  1. BIN
      Budget Projekt/bin/MeinBudgetView/LoginFrame$1.class
  2. BIN
      Budget Projekt/bin/MeinBudgetView/LoginFrame.class
  3. 31
      Budget Projekt/src/MeinBudgetView/LoginFrame.java

BIN
Budget Projekt/bin/MeinBudgetView/LoginFrame$1.class

BIN
Budget Projekt/bin/MeinBudgetView/LoginFrame.class

31
Budget Projekt/src/MeinBudgetView/LoginFrame.java

@ -4,6 +4,8 @@ import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JPanel;
@ -13,13 +15,16 @@ import javax.swing.JButton;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
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.
@ -51,7 +56,7 @@ public class LoginFrame extends JFrame {
setContentPane(contentPane);
contentPane.setLayout(null);
JButton anmelden = new JButton("Anmelden");
anmelden = new JButton("Anmelden");
anmelden.setBounds(182, 168, 97, 23);
contentPane.add(anmelden);
@ -79,13 +84,25 @@ public class LoginFrame extends JFrame {
loginImage.setFont(new Font("Tahoma", Font.BOLD, 13));
contentPane.add(loginImage);
JLabel loginHauptImage = new JLabel("");
loginHauptImage.setBounds(10, 11, 56, 51);
Image image2 = new ImageIcon(this.getClass().getResource("/budgetapp.png")).getImage();
loginHauptImage.setIcon(new ImageIcon(image2));
loginHauptImage.setFont(new Font("Tahoma", Font.BOLD, 13));
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");
}
}
}
Loading…
Cancel
Save