I don’t care to turn a Gallery Topic into a discussion that may be distracting from the the work and will provide feedback here instead. I should have done this initially and deleted my posts from there.
The Gallery is for sharing and discussing your work… feel free to use any of this content I am sharing.
// Add to top:
import processing.javafx.*;
import javafx.scene.paint.Color; // The type Color is ambiguous
gc = canvas.getGraphicsContext2D();
// Added these two lines:
gc.setFill(new Color(1, 1, 1, 0.01)); // ensure a visually transparent (or near-transparent) window/area still participates in mouse event handling in Windows
gc.fillRect(0, 0, displayWidth, displayHeight);
gc.setLineWidth(10.0);
Visitors to this topic:
You will have to add the JAR files for JavaFX to the sketch as well to work with Windows.
A search will yield topics on this.
My lifelong learning journey includes (it is a long list) learning some new programming languages and libraries.
I am learning Java and JavaFX with VSCode outside of the Processing environment but also want to be able to migrate it easily to Processing for future and vice versa.
I adapted the code @svan provided and it will work in both Processing and VSCode Java with some commenting of code.
This is the Processing version with the VSCode parts commented: