-
Bug
-
Resolution: Unresolved
-
P4
-
8, 9, 10, 11
-
None
https://bugs.openjdk.java.net/browse/JDK-6980353 updated the
initialisation of the 2D demo so that it ran on the EDT rather than the
main thread by wrapping all the initialisation like this :
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
initFrame(args);
}
}
This superficially looks OK and is generally the right thing to do.
But whilst updating the demo in JDK 11 I observed that the progress bar
that shows the loading of the components was not being painted before
it disappeared and was replaced. I think that could be attributed to just
loading very quickly but I think it is more than that.
The progress bar is updated after each demo tab is initialised.
This all happens during that main initialisation .. which is now run on the EDT thread.
So whereas before Swing had a chance to paint the UI because the update
came from another thread and it was not blocked, now it is blocked.
I think the initialisation needs to be reworked to be broken up so there are
initialisation tasks for each tab that run on the EDT and then return.
initialisation of the 2D demo so that it ran on the EDT rather than the
main thread by wrapping all the initialisation like this :
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
initFrame(args);
}
}
This superficially looks OK and is generally the right thing to do.
But whilst updating the demo in JDK 11 I observed that the progress bar
that shows the loading of the components was not being painted before
it disappeared and was replaced. I think that could be attributed to just
loading very quickly but I think it is more than that.
The progress bar is updated after each demo tab is initialised.
This all happens during that main initialisation .. which is now run on the EDT thread.
So whereas before Swing had a chance to paint the UI because the update
came from another thread and it was not blocked, now it is blocked.
I think the initialisation needs to be reworked to be broken up so there are
initialisation tasks for each tab that run on the EDT and then return.