Open awvalenti opened 7 years ago
To better understand this issue, check the ConsoleLeds
demo: it does stuff on connected
method, including Thread.sleep
. But connected
is called when Wii Remote is connected, and there's a big call stack happening there.
To be the equivalent of JavaScript's setTimeout(function() {...}, 0).
This applies especially the connected event.
Something like SwingUtilities.invokeLater may do the job, but we should not depend on Swing being available.