HBox root = new HBox();
root.setFillHeight(true);
left = new BorderPane();
Text t = new Text("Left Area");
t.setEffect(new DropShadow(2,3,3,Color.RED));
t.addEventHandler(MouseEvent.MOUSE_PRESSED, new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent event) {
doIt();
}
});
left.setCenter(t);
HBox.setHgrow(left, Priority.ALWAYS);
// left.setMinWidth(800);
// left.setMinHeight(300);
// front.setLayoutX(400);
// front.setLayoutY(300);
rect = new Rectangle(20, 80);
rect.setOpacity(0.7);
rect.setFill(Color.GREEN);
left.getChildren().add(rect);
right = new BorderPane();
t = new Text("right\nside");
t.setTextAlignment(TextAlignment.CENTER);
t.setEffect(new DropShadow(2,3,3,Color.RED));
right.setCenter(t);
HBox.setHgrow(right, Priority.ALWAYS);
// right.setMinWidth(800);
// right.setMinHeight(600);