GridLayout and Panels
I have 3 panels within a frame and I want to make sure that I can size all the panels so that the relevant fields can be seen by the user. Can someone look at my code below and tell me where I'm going wrong.
Thanks
this.setLayout(new GridLayout(3,1));
topPanel = new Panel();
topPanel.add(new Label("Welcome to the OU TMA03 System"));
topPanel.add(new Label("Messages :"));
topPanel.add(messageLabel);
topPanel.add(registerButton);
topPanel.add(loginButton);
add(topPanel);
middlePanel = new Panel();
middlePanel.setBounds(700,300,200,200);
middlePanel.add(new Label("Please enter your details to register with the system"));
middlePanel.add(new Label("Full Name:"));
middlePanel.add(fullName);
middlePanel.add(new Label("Address:"));
middlePanel.add(userAddress);
middlePanel.add(new Label("Telephone Number:"));
middlePanel.add(userTelephone);
middlePanel.add(new Label("Login ID:"));
middlePanel.add(userLogin);
middlePanel.add(new Label("User Password:"));
middlePanel.add(userPassword);
middlePanel.add(new Label("Confirm Password:"));
middlePanel.add(userConfirm);
middlePanel.add(submitRegister);
middlePanel.add(exitRegister);
middlePanel.add(registerMessage);
add(middlePanel);
middlePanel.setVisible(false);
bottomPanel = new Panel();
bottomPanel.add(new Label("Please enter your details to login"));
bottomPanel.add(new Label("User Name:"));
bottomPanel.add(userName);
bottomPanel.add(new Label("Password:"));
bottomPanel.add(logPassword);
bottomPanel.add(submitLogin);
bottomPanel.add(exitLogin);
bottomPanel.add(loginMessage);
add(bottomPanel);
bottomPanel.setVisible(false);
|