Just to make sure it’s clear: Java Swing is single-threaded even on a multi-core machine, and all GUI operations must happen on that one thread. To keep the GUI from stalling, event routines must always return quickly, 0.1 second or so. Longer tasks can be put on a background thread with invokeAsynchronous – these can run as long as needed. Background tasks can pass operations and data back to the GUI thread with invokeLater. After you read the docs, you might find the later.py script module helpful.
1 Like