completed Login Panel and its components

gui
David Groys 2024-06-10 15:03:13 +02:00
parent 6090029284
commit 8f5211a5ef
1 changed files with 28 additions and 9 deletions

View File

@ -67,13 +67,13 @@ public class Main extends JFrame {
logRegScreen.add(loginButton, BorderLayout.WEST); logRegScreen.add(loginButton, BorderLayout.WEST);
logRegScreen.add(registerButton, BorderLayout.EAST); logRegScreen.add(registerButton, BorderLayout.EAST);
loginScreen = new JPanel(new BorderLayout()); loginScreen = new JPanel(new FlowLayout());
loginNameCreate(); loginNameCreate();
loginPasswordCreate(); loginPasswordCreate();
loginConfirmButtonCreate(); loginConfirmButtonCreate();
loginScreen.add(loginName, BorderLayout.NORTH); loginScreen.add(loginName);
loginScreen.add(loginPassword, BorderLayout.CENTER); loginScreen.add(loginPassword);
loginScreen.add(loginConfirmButton, BorderLayout.SOUTH); loginScreen.add(loginConfirmButton);
registerScreen = new JPanel(new FlowLayout()); // flowLayout muss angepasst werden, um nicht scheiße auszusehen registerScreen = new JPanel(new FlowLayout()); // flowLayout muss angepasst werden, um nicht scheiße auszusehen
registerNameCreate(); registerNameCreate();
@ -118,7 +118,8 @@ public class Main extends JFrame {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
cardLayout.show(panelLayout, "2"); cardLayout.show(panelLayout, "2");
jframe.setSize(new Dimension(500, 500)); jframe.setSize(new Dimension(500, 120));
// implementiere einlesen der textfelder des Panles
} }
}); });
@ -133,23 +134,41 @@ public class Main extends JFrame {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
cardLayout.show(panelLayout, "3"); cardLayout.show(panelLayout, "3");
jframe.setSize(new Dimension(500, 500)); jframe.setSize(new Dimension(500, 500));
// implementiere einlesen der textfelder des Panles
} }
}); });
} }
private void loginNameCreate() { private void loginNameCreate() {
loginName = new JPanel(); loginName = new JPanel();
JLabel jl = new JLabel("Name");
JTextField tf = new JTextField(10);
tf.setName("loginNameText");
loginName.add(jl);
loginName.add(tf);
} }
private void loginPasswordCreate() { private void loginPasswordCreate() {
loginPassword = new JPanel(); loginPassword = new JPanel();
JLabel jl = new JLabel("Passwort");
JTextField tf = new JTextField(10);
tf.setName("loginPasswordText");
loginPassword.add(jl);
loginPassword.add(tf);
} }
private void loginConfirmButtonCreate() { private void loginConfirmButtonCreate() {
loginConfirmButton = new JButton(); loginConfirmButton = new JButton("Confirm");
loginConfirmButton.setPreferredSize(new Dimension(80, 20));
loginConfirmButton.setFocusable(false);
loginConfirmButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
cardLayout.show(panelLayout, "4");
jframe.setSize(new Dimension(500, 500));
// implementiere einlesen der textfelder des Panles
}
});
} }
private void registerNameCreate() { private void registerNameCreate() {