Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8203167

Rework initialisation of J2Ddemo

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 8, 9, 10, 11
    • client-libs
    • None
    • 8

      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.

            Unassigned Unassigned
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: