American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

3 PM – Intro To Java

June 13, 2020 @ 3:00 pm - 4:00 pm

  1. We went over FlowPane
  2. We went over BorderPane
  3. Homework:
    1. Modify the BorderPane project that we did in the class. I have uploaded the files to the google drive if you missed the last class.
      1. Inside sample.fxml on the BorderPane tag element, add the following
      2. fx:controller="sample.Controller"
      3. So it will probably look similar to this
      4. <BorderPane fx:controller="sample.Controller" prefHeight="300.0" prefWidth="400.0" xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1">
    2. Remove all the buttons on the top and on the left sections.
    3. Remove the top FlowPane and left FlowPane.
    4. Add a FlowPane on the bottom of BorderPane.
    5. Using BorderPane, FlowPane and Gridpane like we learned last week, create a user interface like the following:
    6. When you click Show Info button do the following
      1. It needs to call the Controller.showInforAlert method like below
        1. public void showInfoAlert(ActionEvent ae) {
              Alert a = new Alert(Alert.AlertType.INFORMATION);
              String message = "Hello World\n";
              message += "JavaFX";
              a.setHeaderText("Welcome To AYCLOGIC");
              a.setContentText(message);
              a.show();
          }
      2. You need to connect the sample.fxml “Show Info” button with this “showInfoAlert(ActionEvent ae)” method like we have done in the class before.
      3. If you do it correctly, when you click the “Show Info” button, it will show a popup dialog like the following
    7. When you click Submit button it will do the following
      1. Get the text from the first text field. The one right next to the First Name label.
      2. Get the text from the second text field. The one right next to the Last Name label.
      3. Get the text from the last text field. The one right next to the Phone label.
      4. Display an alert with all of those 3 informations from the text fields like the following
        1. You need to follow example fro “Show Info” button on how to create an Alert Dialog like above.
    8. When you click Clear button, it will clear all the 3 text fields.

Details

Date:
June 13, 2020
Time:
3:00 pm - 4:00 pm
Event Category: