Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8100973 CLONE - Optimize dtfx.js
  3. JDK-8101573

CLONE - When JavaScript calls back to the JavaFX Applet, it is not on the Main JavaFX thread.

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: fx1.3
    • Fix Version/s: fx2.0
    • Component/s: deploy
    • Environment:

      JavaFX 1.0
      snv_102 i86pc.

      Description

      I found the hard way that I had to use FX.deferAction()
      when calling back to JavaFX from JavaScript.

      // The applet uses this to set the current Image shown
      public function setCurrentPic(ndx:Integer) : Void {
        FX.deferAction(function(): Void {
            try {
                imageList.setIndex(ndx);
            } catch(ex: java.lang.Exception) {
                applet.eval("alert('{ex}')");
            }
        });
      }

      Without the deferAction() it sometimes would work, other times I would
      get a SecurityException when trying to fetch the associated image off the net.
      With deferAction it all seems to work fine.

      I would have thought that this would be automagically done
      by the JavaScript to JavaFX framework?

        Attachments

          Activity

            People

            Assignee:
            igor Igor Nekrestyanov (Inactive)
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: