Embedding Processing 3 Sketch Into Swing

Launching Processing in the default JAVA2D mode creates a swing frame and embeds an AWT canvas (the element that Processing draws on) into it. You can expose the frame and canvas and do anything you want with them: see Show an desktop menu bar and Javax swing JFrame in the main processing PApplet.

Unless you have to use swing, you could use Processing’s JAVAFX mode and create a GUI using JavaFX instead – you can even use SceneBuilder to design the UI and load it into Processing.

2 Likes