D
david.karr
When I first did Swing work several years ago, it was well known that
after Swing components were "realized", all access to them had to be
done on the Event Dispatch Thread. That means that ordinary assembly
of the required components, before they are shown, didn't have to
happen on the EDT.
It appears that the recommendations in JDK 1.6 have changed this. At
<http://java.sun.com/javase/6/docs/api/javax/swing/package-
summary.html>, in the "Swing's Threading Policy" section, it concludes
that ALL access to Swing components, even construction, has to be on
the EDT. This seems odd. Besides the statements at that javadoc
page, is there any justification for this change in strategy? Is
there really code now that executes in the constructor of a Swing
component that needs to execute on the EDT?
after Swing components were "realized", all access to them had to be
done on the Event Dispatch Thread. That means that ordinary assembly
of the required components, before they are shown, didn't have to
happen on the EDT.
It appears that the recommendations in JDK 1.6 have changed this. At
<http://java.sun.com/javase/6/docs/api/javax/swing/package-
summary.html>, in the "Swing's Threading Policy" section, it concludes
that ALL access to Swing components, even construction, has to be on
the EDT. This seems odd. Besides the statements at that javadoc
page, is there any justification for this change in strategy? Is
there really code now that executes in the constructor of a Swing
component that needs to execute on the EDT?