Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
TheophileZT committed Nov 13, 2023
2 parents a1d4d61 + b289eac commit 484b49e
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/main/java/view/Vue.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ private static void createAndShowSignUpForm() {
//Create all the components.
JPanel typePanel = new JPanel();
JPanel formPanel = new JPanel();
JPanel namePanel = new JPanel();
JLabel labelTitle = new JLabel("Sign Up", JLabel.CENTER);
JLabel labelName = new JLabel("Name");
JTextField textFieldName = new JTextField();
JLabel labelFirstName = new JLabel("First Name");
JTextField textFieldFirstName = new JTextField();
JLabel labelLastName = new JLabel("Last Name");
JTextField textFieldLastName = new JTextField();
JLabel labelEmail = new JLabel("Email");
JTextField textFieldEmail = new JTextField();
JLabel labelPassword = new JLabel("Password");
Expand All @@ -58,15 +61,24 @@ private static void createAndShowSignUpForm() {
formPanel.setLayout(new BoxLayout(formPanel, BoxLayout.Y_AXIS));
frame.getContentPane().add(formPanel, "North");
frame.getContentPane().add(validateButton, "South");
namePanel.setLayout(new BoxLayout(namePanel, BoxLayout.X_AXIS));
labelFirstName.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
labelLastName.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));


//Add the components to the panel.
typePanel.add(checkBoxIsNeeder);
typePanel.add(checkBoxIsVolunteer);
typePanel.add(checkBoxIsValidator);

namePanel.add(labelFirstName);
namePanel.add(textFieldFirstName);
namePanel.add(labelLastName);
namePanel.add(textFieldLastName);


formPanel.add(labelTitle);
formPanel.add(labelName);
formPanel.add(textFieldName);
formPanel.add(namePanel);
formPanel.add(typePanel);
formPanel.add(labelEmail);
formPanel.add(textFieldEmail);
Expand Down Expand Up @@ -103,8 +115,8 @@ private static void createAndShowSignUpForm() {
}
});

validateButton.addActionListener(actionEvent -> Controller.createNewUser(labelTitle.getText(),
textFieldName.getText(),
validateButton.addActionListener(actionEvent -> Controller.createNewUser(textFieldFirstName.getText(),
textFieldLastName.getText(),
textFieldEmail.getText(),
Arrays.toString(passwordField.getPassword()),
checkBoxIsNeeder.isSelected(),
Expand Down

0 comments on commit 484b49e

Please sign in to comment.