organized PanleLayout and initialized attributes in corresponding methods

gui
David Groys 2024-06-10 14:55:21 +02:00
parent 4a3c4dbcea
commit 8d83fc784c
1 changed files with 53 additions and 35 deletions

View File

@ -12,6 +12,7 @@ public class Main extends JFrame {
public static void main(String[] args) { public static void main(String[] args) {
Main main = new Main("35a75437476f12302f72e55d368485db"); Main main = new Main("35a75437476f12302f72e55d368485db");
} }
private Application facade; private Application facade;
private JFrame jframe; private JFrame jframe;
@ -60,117 +61,134 @@ public class Main extends JFrame {
logRegScreen = new JPanel(new BorderLayout()); logRegScreen = new JPanel(new BorderLayout());
loginButtonCreate(); loginButtonCreate();
registerButtonCreate(); registerButtonCreate();
logRegScreen.add(loginButton, BorderLayout.WEST);
logRegScreen.add(registerButton, BorderLayout.EAST);
loginScreen = new JPanel(new BorderLayout()); loginScreen = new JPanel(new BorderLayout());
loginNameCreate(); loginNameCreate();
loginPasswortCreate(); loginPasswordCreate();
loginConfirmButtonCreate(); loginConfirmButtonCreate();
loginScreen.add(loginName, BorderLayout.NORTH);
loginScreen.add(loginPassword, BorderLayout.CENTER);
loginScreen.add(loginConfirmButton, BorderLayout.SOUTH);
registerScreenCreate(); registerScreen = new JPanel(new FlowLayout()); // flowLayout muss angepasst werden, um nicht scheiße auszusehen
registerNameCreate(); registerNameCreate();
registerPasswortCreate(); registerPasswordCreate();
registerOrtCreate(); registerOrtCreate();
registerPLZCreate(); registerPLZCreate();
registerCarSpeed(); registerCarSpeedCreate();
registerBikeSpeed(); registerBikeSpeedCreate();
registerConfirmButton(); registerConfirmButtonCreate();
registerScreen.add(registerName);
registerScreen.add(registerPassword);
registerScreen.add(registerOrt);
registerScreen.add(registerCarSpeed);
registerScreen.add(registerBikeSpeed);
registerScreen.add(registerConfirmButton);
menu = new JPanel(new BorderLayout()); menu = new JPanel(new BorderLayout());
searchPLZCreate(); searchPLZCreate();
searchOrtCreate(); searchOrtCreate();
searchConfirmButton(); searchConfirmButtonCreate();
threeRandomDestinationsButtonCreate(); threeRandomDestinationsButtonCreate();
logOutButtonCreate(); logOutButtonCreate();
// muss noch konzepiert werden
panelLayout.add(logRegScreen, "1");
panelLayout.add(loginScreen, "2");
panelLayout.add(registerScreen, "3");
panelLayout.add(menu, "4");
cardLayout.show(panelLayout, "1");
jframe.add(panelLayout);
jframe.setResizable(false);
jframe.setSize(500, 500);
jframe.setLocationRelativeTo(null);
jframe.setVisible(true);
} }
private void loginButtonCreate() { private void loginButtonCreate() {
// TODO Auto-generated method stub loginButton = new JButton();
} }
private void registerButtonCreate() { private void registerButtonCreate() {
// TODO Auto-generated method stub registerButton = new JButton();
} }
private void loginNameCreate() { private void loginNameCreate() {
// TODO Auto-generated method stub loginName = new JPanel();
} }
private void loginPasswortCreate() { private void loginPasswordCreate() {
// TODO Auto-generated method stub loginPassword = new JPanel();
} }
private void loginConfirmButtonCreate() { private void loginConfirmButtonCreate() {
// TODO Auto-generated method stub loginConfirmButton = new JButton();
}
private void registerScreenCreate() {
// TODO Auto-generated method stub
} }
private void registerNameCreate() { private void registerNameCreate() {
// TODO Auto-generated method stub registerName = new JPanel();
} }
private void registerPasswortCreate() { private void registerPasswordCreate() {
// TODO Auto-generated method stub registerPassword = new JPanel();
} }
private void registerOrtCreate() { private void registerOrtCreate() {
// TODO Auto-generated method stub registerOrt = new JPanel();
} }
private void registerPLZCreate() { private void registerPLZCreate() {
// TODO Auto-generated method stub registerPLZ = new JPanel();
} }
private void registerCarSpeed() { private void registerCarSpeedCreate() {
// TODO Auto-generated method stub registerCarSpeed = new JPanel();
} }
private void registerBikeSpeed() { private void registerBikeSpeedCreate() {
// TODO Auto-generated method stub registerBikeSpeed = new JPanel();
} }
private void registerConfirmButton() { private void registerConfirmButtonCreate() {
// TODO Auto-generated method stub registerConfirmButton = new JButton();
} }
private void searchPLZCreate() { private void searchPLZCreate() {
// TODO Auto-generated method stub searchPLZ = new JPanel();
} }
private void searchOrtCreate() { private void searchOrtCreate() {
// TODO Auto-generated method stub searchOrt = new JPanel();
} }
private void searchConfirmButton() { private void searchConfirmButtonCreate() {
// TODO Auto-generated method stub searchConfirmButton = new JButton();
} }
private void threeRandomDestinationsButtonCreate() { private void threeRandomDestinationsButtonCreate() {
// TODO Auto-generated method stub threeRandomDestinationsButton = new JButton();
} }
private void logOutButtonCreate() { private void logOutButtonCreate() {
// TODO Auto-generated method stub logOutButton = new JButton();
} }