You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
52 lines
1.2 KiB
package ui;
|
|
|
|
import java.util.*;
|
|
import javax.swing.*;
|
|
import playground.Playground;
|
|
import java.awt.event.*;
|
|
|
|
public class LoginWindow extends GameUIWithLogin {
|
|
|
|
JFileChooser fc;
|
|
JFrame frame = null;
|
|
JPanel contentPane = null;
|
|
JTextField tf1 = null;
|
|
JTextField tf2 = null;
|
|
JLabel name = null;
|
|
JLabel password = null;
|
|
JButton login = null;
|
|
|
|
public LoginWindow(int sizeX, int sizeY) {
|
|
super(sizeX, sizeY);
|
|
|
|
this.frame = new JFrame("Login");
|
|
|
|
this.contentPane = new JPanel();
|
|
this.frame.setContentPane(this.contentPane);
|
|
|
|
this.tf1 = new JTextField("",20);
|
|
this.tf2 = new JTextField("",20);
|
|
|
|
this.name = new JLabel("Login: ");
|
|
this.password = new JLabel("Passwort: ");
|
|
|
|
this.contentPane.add(this.name);
|
|
this.contentPane.add(this.tf1);
|
|
this.contentPane.add(this.password);
|
|
this.contentPane.add(this.tf2);
|
|
|
|
this.login = new JButton("Login");
|
|
this.contentPane.add(this.login);
|
|
|
|
this.tf1.addActionListener(this);
|
|
this.tf2.addActionListener(this);
|
|
this.login.addActionListener(this);
|
|
|
|
this.frame.setSize(250, 300);
|
|
this.frame.setVisible(true);
|
|
}
|
|
|
|
public static int getNewAction() {
|
|
return getNewAction();
|
|
}
|
|
}
|