title: Javafx buttons not functioning properly, and pane not resizing
body: <p>Currently the code below produces a BorderPane with a GridPane in the center and a HBox on the bottom to hold two buttons.  The left-most pane in the GridPane contains the text "Name Here". Right now I only want the buttons to move the text "Name Here" up and down but they will not move the text.</p>
  
  <p>I think it has something to do with the particular GridPane node, but I'm not sure.  Additionally, I don't know why the left-most GridPane takes up more space relative to the right-most GridPane within the center of the BorderPane.</p>
  
  <p>Any advice will be greatly appreciated, thank you!</p>
  
  <pre><code>    import javafx.application.Application;
      import javafx.stage.Stage;
      import javafx.geometry.Pos;
      import javafx.geometry.HPos;
      import javafx.geometry.VPos;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.layout.HBox;
      import javafx.scene.layout.Pane;
      import javafx.scene.layout.BorderPane;
      import javafx.scene.layout.GridPane;
      import javafx.scene.layout.StackPane;
      import javafx.scene.layout.Priority;
      import javafx.scene.text.Text;   
  
  
      public class differentWindows extends Application {
  
        protected Text name = new Text("Name Here");
  
        protected BorderPane getPane() {
  
        // HBox to hold the up and down buttons
        HBox paneForButtons = new HBox(20);
        Button btUp = new Button("Up");
        Button btDown = new Button("Down");
        paneForButtons.getChildren().addAll(btUp, btDown);
        paneForButtons.setAlignment(Pos.BOTTOM_LEFT);
  
        // Grid pane to go in center of the border pane, for the name and video    
        GridPane paneForTextNVideo = new GridPane();
        paneForTextNVideo.setAlignment(Pos.CENTER);
        paneForTextNVideo.setGridLinesVisible(true);
        paneForTextNVideo.add(name, 0, 0);
  
        Text temp = new Text("temp");
        paneForTextNVideo.add(temp, 1, 0);
        paneForTextNVideo.setHalignment(temp, HPos.CENTER);
        paneForTextNVideo.setValignment(temp, VPos.CENTER);
        paneForTextNVideo.setHgrow(temp, Priority.ALWAYS);
        paneForTextNVideo.setVgrow(temp, Priority.ALWAYS);
  
        paneForTextNVideo.setHalignment(name, HPos.CENTER);
        paneForTextNVideo.setValignment(name, VPos.CENTER);
        paneForTextNVideo.setHgrow(name, Priority.ALWAYS);
        paneForTextNVideo.setVgrow(name, Priority.ALWAYS);
  
        // Border pane to hold all windows
        BorderPane pane = new BorderPane();
        pane.setBottom(paneForButtons);  
        pane.setCenter(paneForTextNVideo);
  
        btUp.setOnAction(e -&gt; name.setY(name.getY() - 10));
        btDown.setOnAction(e -&gt; name.setY(name.getY() + 10));
  
        return pane;     
  
        } // end of the getPane method
  
  
        @Override
        public void start(Stage primaryStage) {
  
        Scene scene = new Scene(getPane(), 450, 200);
        primaryStage.setTitle("Assignment #7");
        primaryStage.setScene(scene);
        primaryStage.show();
  
        } // end of start method
  
        public static void main(String[] args) {
        Application.launch(args);
        }
  
      } // end of class
  </code></pre>