import javafx.geometry.Insets;
import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;

/*
 * File: FacePamphletCanvas.java
 * -----------------------------
 * This class represents the canvas on which the profiles in the social
 * network are displayed.  NOTE: This class does NOT need to update the
 * display when the window is resized.
 */

// This isn't really a canvas but we'll keep the class name to stay as close to the assignment as possible
public class FacePamphletCanvas extends VBox implements FacePamphletConstants {
    private static final int MESSAGE_FONT_SIZE = 18;
    private static final int PROFILE_NAME_FONT_SIZE = 24;
    private static final int PROFILE_FRIENDS_LIST_FONT_SIZE = 16;
    private static final int PROFILE_STATUS_FONT_SIZE = 16;

    private Text profileFriendsList;
    private ImageView profileImage;
    private Text profileNameLabel;
    private Text profileStatusLabel;
    private Label messageLabel;

    /**
     * Constructor This method takes care of any initialization needed for the
     * display
     */
    public FacePamphletCanvas() {
        // this.setMaxHeight(Double.MAX_VALUE);

        HBox topPamphletPane = new HBox();

        VBox leftProfilePane = createLeftProfilePane();

        profileFriendsList = new Text();
        profileFriendsList.setFont(new Font(PROFILE_FRIENDS_LIST_FONT_SIZE));

        topPamphletPane.getChildren().addAll(leftProfilePane, profileFriendsList);

        messageLabel = new Label();
        messageLabel.setFont(new Font(MESSAGE_FONT_SIZE));
        // messageLabel.setMaxHeight(Double.MAX_VALUE);
        // messageLabel.setMaxWidth(Double.MAX_VALUE);
        // messageLabel.setAlignment(Pos.BOTTOM_CENTER);
        // messageLabel.setContentDisplay(ContentDisplay.BOTTOM);

        // TODO: add bottom margin

        this.getChildren().addAll(topPamphletPane, messageLabel);
    }

    private VBox createLeftProfilePane() {
        VBox leftProfilePane = new VBox();

        profileNameLabel = new Text();
        profileNameLabel.setFont(new Font(PROFILE_NAME_FONT_SIZE));
        profileNameLabel.setFill(Color.BLUE);
        VBox.setMargin(profileNameLabel, new Insets(TOP_MARGIN, 0, 0, LEFT_MARGIN));

        profileImage = new ImageView();
        profileImage.setFitHeight(IMAGE_HEIGHT);
        profileImage.setFitWidth(IMAGE_WIDTH);
        VBox.setMargin(profileImage, new Insets(IMAGE_MARGIN, 0, 0, LEFT_MARGIN));

        profileStatusLabel = new Text();
        profileStatusLabel.setFont(new Font(PROFILE_STATUS_FONT_SIZE));
        VBox.setMargin(profileStatusLabel, new Insets(STATUS_MARGIN, 0, 0, LEFT_MARGIN));

        leftProfilePane.getChildren().addAll(profileNameLabel, profileImage, profileStatusLabel);

        return leftProfilePane;
    }

    /**
     * This method displays a message string near the bottom of the canvas.
     * Every time this method is called, the previously displayed message (if
     * any) is replaced by the new message text passed in.
     */
    public void showMessage(String msg) {
        messageLabel.setText(msg);
    }

    /**
     * This method displays the given profile on the canvas. The canvas is first
     * cleared of all existing items (including messages displayed near the
     * bottom of the screen) and then the given profile is displayed. The
     * profile display includes the name of the user from the profile, the
     * corresponding image (or an indication that an image does not exist), the
     * status of the user, and a list of the user's friends in the social
     * network.
     */
    public void displayProfile(FacePamphletProfile profile) {
        showMessage("");

        profileNameLabel.setText(profile.getName());
        profileStatusLabel.setText(profile.getStatus());
        profileImage.setImage(profile.getImage());

        // TODO: show friends
    }

    public void clearProfile() {
        profileFriendsList.setText("");
        profileImage.setImage(null);
        profileNameLabel.setText("");
        profileStatusLabel.setText("");
    }
}

@@ -123,20 +123,26 @@
 .layout.
-H
 Bo
-x
+rderPane
 ;%0Aimport
@@ -668,20 +668,26 @@
 extends 
-V
 Bo
-x
+rderPane
  impleme
@@ -1286,146 +1286,176 @@
     
-// this.setMaxHeight(Double.MAX_VALUE);%0A%0A        HBox topPamph
+VBox leftProfi
 le
-t
 Pane = 
-new HBox();%0A%0A        VBox leftProfilePane = createLeftProfilePane(
+createLeftProfilePane();%0A%0A        this.setCenter(leftProfilePane);%0A        BorderPane.setMargin(leftProfilePane, new Insets(0, 0, 0, LEFT_MARGIN)
 );%0A%0A
@@ -1587,61 +1587,21 @@
    t
-opPamphletPane.getChildren().addAll(leftProfilePane, 
+his.setRight(
 prof
@@ -1713,24 +1713,25 @@
 SIZE));%0A
+%0A
         
 // messa
@@ -1726,334 +1726,133 @@
     
-// messageLabel.setMaxHeight(Double.MAX_VALUE);%0A        // messageLabel.setMaxWidth(Double.MAX_VALUE);%0A        // messageLabel.setAlignment(Pos.BOTTOM_CENTER);%0A        // messageLabel.setContentDisplay(ContentDisplay.BOTTOM);%0A%0A        // TODO: add bottom margin%0A%0A        this.getChildren().addAll(topPamphletPane, messageLabel
+this.setBottom(messageLabel);%0A        BorderPane.setMargin(messageLabel, new Insets(0, 0, BOTTOM_MESSAGE_MARGIN, LEFT_MARGIN)
 );%0A 
@@ -2163,35 +2163,25 @@
 RGIN, 0, 0, 
-LEFT_MARGIN
+0
 ));%0A%0A       
@@ -2373,35 +2373,25 @@
 RGIN, 0, 0, 
-LEFT_MARGIN
+0
 ));%0A%0A       
@@ -2567,35 +2567,25 @@
 RGIN, 0, 0, 
-LEFT_MARGIN
+0
 ));%0A%0A       

Use borderpane for pamphlet canvas and move message label to the bottom