Swing Components in Default ProcessingWindow

Re-read what I said! This is nothing to do with how good or not Swing is. I’m actively involved in developing various Swing projects (eg. NetBeans). Swing components need to be used on the Swing event thread. That is not the Processing animation thread.

Swing event handling code runs on a special thread known as the event dispatch thread. … Some Swing component methods are labelled “thread safe” in the API specification; these can be safely invoked from any thread. All other Swing component methods must be invoked from the event dispatch thread. Programs that ignore this rule may function correctly most of the time, but are subject to unpredictable errors that are difficult to reproduce.

From https://docs.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html