2013-08-26 44 views
1

我想設置BorderPane的中心,頂部,左側,右側和底部組件的大小。設置BorderPane組件的大小

enter image description here

到目前爲止,我發現這一點:

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

例如,我怎麼能得到一個BorderPane的左側的大小和設置大小?

回答

1

BorderPane的「左」是您設置的任何值,它的大小就是您設置的任何值。

例如:

BorderPane mainpane = new BorderPane(); 
StackPane left = new StackPane(); 
left.setPrefWidth(100); 
mainPane.setLeft(left);