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

Swing application stops without any jvm dumps or logs with JFXPanel and WebView

XMLWordPrintable

    • web
    • x86_64
    • windows_10

      A DESCRIPTION OF THE PROBLEM :
      OS: win 10 (64bit)

      Simply created a swing application with JFXPanel and WebView.

      Deployment: Classpath

      Added all jar files (except ..swt.jar) to classpath and copied all dlls to the same directory in the classpath.

      Showing a web page with WebView/WebEngine stops the application without any jvm dumps or logs...

      If I try the same application with openJFX 11.0.2, no crash

      tried with openJDK 12 (32, 64 bit), openJDK 14 (64 bit)
      same problem

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Simply use WebView

      ACTUAL -
      crash

      ---------- BEGIN SOURCE ----------
      public class WebPreview extends JFXPanel
      {
      private WebEngine engine;

      private String sURL;

      public WebPreview()
      {
      Platform.setImplicitExit(false);
      Platform.runLater(new Runnable()
      {
                  @Override
                  public void run()
                  {
                      StackPane root = new StackPane();
                      Scene scene = new Scene(root);
                      
                      WebView web = new WebView();
                      
                      engine = web.getEngine();

                      root.getChildren().add(web);

                      setScene(scene);
                  }
             });
      }

      /**
      * Sets the URL.
      *
      * @param pURL the URL
      */
      public void setURL(String pURL)
      {
      sURL = pURL;

      Platform.runLater(new Runnable()
      {
                  @Override
                  public void run()
                  {
      engine.load(sURL);
                  }
      });
      }

      public String getURL()
      {
      return sURL;
      }

      }

      Use above class in a swing application and set the URL property. I set the URL via Thread:
      e.g.

      Thread th = new Thread(new Runnable()
      {
      @Override
      public void run()
      {
      browser.load(sServer + "/screen/web/ui/?Application.language=en" +
      "&Application.WelcomeScreen=" + sScreenName +
      "&Application.responsive.mini.width=" + (ResponsiveUtil.getMaxWidth(visionx.getLauncher(), LayoutMode.Mini) - 125) +
      "&Application.responsive.small.width=" + (ResponsiveUtil.getMaxWidth(visionx.getLauncher(), LayoutMode.Small) - 125));
      }
      });
      th.start();

      ---------- END SOURCE ----------

      FREQUENCY : always


            pnarayanaswa Praveen Narayanaswamy
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: