Set BorderPane components size


Question

I want to set the size of the Center, Top, Left, Right and Bottom components of a BorderPane.

enter image description here

So far I found this:

BorderPane() mainpane = new BorderPane();
mainPane.getBottom().prefWidth(sizeX);

For example how I can you get the size of a Left side of a BorderPane and set the size?

1
2
8/26/2013 10:23:16 AM

the "Left" of a BorderPane is whatever you set it to and it's size is whatever you set it to.

example:

BorderPane mainpane = new BorderPane();
StackPane left = new StackPane();
left.setPrefWidth(100);
mainPane.setLeft(left);
2
8/26/2013 1:42:40 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon