Javatpoint Logo
Javatpoint Logo

JavaFX BorderPane

BorderPane arranges the nodes at the left, right, centre, top and bottom of the screen. It is represented by javafx.scene.layout.BorderPane class. This class provides various methods like setRight(), setLeft(), setCenter(), setBottom() and setTop() which are used to set the position for the specified nodes. We need to instantiate BorderPane class to create the BorderPane layout.

Properties

The properties of BorderPane class along with their setter methods are given in the table below.

Type Property Setter Methods Description
Node Bottom setBottom() Add the node to the bottom of the screen
Node Centre setCentre() Add the node to the centre of the screen
Node Left setLeft() Add the node to the left of the screen
Node Right setRight() Add the node to the right of the screen
Node Top setTop() Add the node to the top of the screen

Constructors

There are the following constructors in the class.

  1. BorderPane() : create the empty layout
  2. BorderPane(Node Center) : create the layout with the center node
  3. BorderPane(Node Center, Node top, Node right, Node bottom, Node left) : create the layout with all the nodes

Example


JavaFX BorderPane Output
Next TopicJavaFX HBox




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA