Resize Processing canvas in JavaFX window

I am wondering how I can resize the processing canvas that’s contained in my JavaFX app.

Processing.java:

    @Override
    public void settings() {
        size(0,0,FX2D);
        fullScreen();
    }

    @Override
    public void setup() {
        surface.setResizable(true);
    }

(Not shown is the PSurface initSurface())

For my FXML, I am using a BorderPane and in the center, is a VBox.

BorderPane root = FXMLLoader.load(getClass().getResource("app.fxml"));

        VBox pane = (VBox) root.getCenter();

        processingCanvas.widthProperty().bind(pane.widthProperty());
        processingCanvas.heightProperty().bind(pane.heightProperty());

        // Adding the canvas to App
        root.getChildren().add(processingCanvas);

And what I get is this:

Is this possible to do in Processing and JavaFX? If not I may have to stick with JavaFX for my project…

1 Like

From your screenshot – what is happening? Are you able to drag the window frame out it reveals the white area, but the gray Processing sketch area stays the same size?

Yes, I dragged the window out and the rest is white, the javafx window. Sorry the screenshot is hard to tell. The processing window does stay the same.

Try taking a look at this one :