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

LCD text rendering breaks JFXPanel w/ embedded WebView completely

XMLWordPrintable

    • web

      Execute the following simple test that embeds a web view into Swing:

      import javafx.application.Platform;
      import javafx.embed.swing.JFXPanel;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.web.WebEngine;
      import javafx.scene.web.WebView;

      import javax.swing.JFrame;
      import javax.swing.SwingUtilities;

      public class EmbedWebView
      {
          private static void initAndShowGUI()
          {
              JFrame f = new JFrame();
              f.setSize(640, 480);
              f.setLocationRelativeTo(null);

              final JFXPanel p = new JFXPanel();
              f.add(p);

              Platform.runLater(new Runnable()
              {
                  @Override
                  public void run()
                  {
                      Group g = new Group();
                      g.getChildren().add(new WebView(new WebEngine("http://www.oracle.com")));
                      Scene s = new Scene(g);
                      p.setScene(s);
                  }
              });

              f.setVisible(true);
          }

          public static void main(String[] args)
          {
              SwingUtilities.invokeLater(new Runnable()
              {
                  @Override
                  public void run()
                  {
                      initAndShowGUI();
                  }
              });
          }
      }


      With the latest LCD text changes (RT-14208), the WebView is completely broken, and the console is full of exceptions:

      java.lang.NullPointerException
      at com.sun.prism.impl.ps.BaseShaderGraphics.drawString(BaseShaderGraphics.java:1206)
      at com.sun.webpane.sg.prism.WCGraphicsPrismContext.drawString(WCGraphicsPrismContext.java:555)
      at com.sun.webpane.platform.graphics.GraphicsDecoder.decode(GraphicsDecoder.java:317)
      at com.sun.webpane.platform.graphics.WCRenderQueue.decode(WCRenderQueue.java:34)
      at com.sun.webpane.platform.WebPage.paint2GC(WebPage.java:636)
      at com.sun.webpane.platform.WebPage.paint(WebPage.java:615)
      at com.sun.javafx.sg.prism.NGWebView.renderContent(NGWebView.java:77)
      at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:103)
      at com.sun.javafx.sg.prism.NGGroup.doRender(NGGroup.java:291)
      at com.sun.javafx.sg.prism.NGGroup.doRender(NGGroup.java:27)
      at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1013)
      at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:180)
      at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:103)
      at com.sun.javafx.sg.prism.NGGroup.doRender(NGGroup.java:291)
      at com.sun.javafx.sg.prism.NGGroup.doRender(NGGroup.java:27)
      at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1013)
      at com.sun.javafx.tk.quantum.EmbeddedScene$PaintRunnable.paintImpl(EmbeddedScene.java:139)
      at com.sun.javafx.tk.quantum.EmbeddedScene$PaintRunnable.run(EmbeddedScene.java:172)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
      at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
      at com.sun.prism.render.RenderJob.run(RenderJob.java:29)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at com.sun.javafx.tk.quantum.QuantumRenderer$ObservedRunnable.run(QuantumRenderer.java:70)
      at java.lang.Thread.run(Thread.java:729)

            jandrese Joe Andresen (Inactive)
            art Artem Ananiev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: