Type an EDT-safe UI update from a background thread
Type an EDT-safe UI update from a background thread
Answer
SwingUtilities.invokeLater(() -> log.append("Event fired: LightOn\n"));
invokeLater queues the Runnable onto the EDT’s event queue — the only safe way for a worker thread to touch a Swing component.