bitguru blog

a guru of bits, or just a bit player?

Archive for June 12th, 2007

Swing single threading rule and JSR-296

Posted by bitguru on June 12, 2007

I didn’t make it to the JavaOne conference this year, but I notice that the slides and video (registration required) have been posted for the session on JSR-296: Swing Application Framework.

The Swing Application Framework has a number of goals, but one of them is to provide an Application class that has lifecycle methods for the programmer to implement, sort of like the existing Applet class. Application makes it easier not to violate the more-stringent Swing threading rule by invoking its startup method on the event thread. [I originally wrote by automatically invoking but it's not automatic. One must call launch(MyClass.class, argv) from main, which then calls startup(argv) via reflection.]

The idea is that JSR-296 will eventually be part of the JDK7 or JDK8. It’s possible to use it now as an external library, but the API is subject to change. It’s also possible to write code inspired by JSR-296 without actually using the library. Like other attempts to comply with the Swing threading rule, this is ugly but I throw it out there for discussion. Read the rest of this entry »

Posted in Java, Swing | Leave a Comment »