I wan to get the size of the left side of a BorderPane In JavaFX 8. I tested this:
mainPanel.getRight().getBoundsInLocal().getWidth(); I think that this is not the correct way. Can you show me how I can do this if it's possible? I tested this code: I get the width of the Left side of a BorderPane, then I set the width of a TabPane: BorderPane mainPanel new BorderPane(); tabPane.setPrefWidth(mainPanel.getRight().getBoundsInLocal().getWidth()); I get NPE. Can you help me to correct my mistake? I want when I resize the Center of the BorderPane to update the size of the TabPane(shrink it or expand it dynamically).