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)
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 (
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)
- duplicates
-
JDK-8114209 Build 32 has broken my WebView applet demo
-
- Closed
-