To reproduce on attached app:
- just double click the window title bar after starting (do not click anything except title bar);
- NPE occurs;
Exception in runnable
java.lang.NullPointerException
at javafx.scene.Scene$ClickCounter.access$5000(Scene.java:2489)
at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:2649)
at javafx.scene.Scene$ClickGenerator.access$6200(Scene.java:2585)
at javafx.scene.Scene$MouseHandler.process(Scene.java:2906)
at javafx.scene.Scene$MouseHandler.process(Scene.java:2691)
at javafx.scene.Scene$MouseHandler.access$1300(Scene.java:2657)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1281)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:1915)
at com.sun.javafx.tk.quantum.EmbeddedScene$2.run(EmbeddedScene.java:175)
at com.sun.javafx.application.PlatformImpl$3.run(PlatformImpl.java:141)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2531)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
at JavaFXonSWT.main(JavaFXonSWT.java:29)
import javafx.embed.swt.FXCanvas;
import javafx.scene.Scene;
import javafx.scene.web.WebView;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class JavaFXonSWT
{
public static void main(String[] args)
{
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("JavaFX on SWT");
shell.setLayout(new FillLayout());
FXCanvas fxcanvas = new FXCanvas(shell, SWT.NONE);
WebView view = new WebView();
Scene scene = new Scene(view);
fxcanvas.setScene(scene);
fxcanvas.setVisible(true);
shell.open();
while (!shell.isDisposed())
{
if(!display.readAndDispatch())
{
display.sleep();
}
}
display.dispose();
}
}
- just double click the window title bar after starting (do not click anything except title bar);
- NPE occurs;
Exception in runnable
java.lang.NullPointerException
at javafx.scene.Scene$ClickCounter.access$5000(Scene.java:2489)
at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:2649)
at javafx.scene.Scene$ClickGenerator.access$6200(Scene.java:2585)
at javafx.scene.Scene$MouseHandler.process(Scene.java:2906)
at javafx.scene.Scene$MouseHandler.process(Scene.java:2691)
at javafx.scene.Scene$MouseHandler.access$1300(Scene.java:2657)
at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1281)
at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:1915)
at com.sun.javafx.tk.quantum.EmbeddedScene$2.run(EmbeddedScene.java:175)
at com.sun.javafx.application.PlatformImpl$3.run(PlatformImpl.java:141)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2531)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
at JavaFXonSWT.main(JavaFXonSWT.java:29)
import javafx.embed.swt.FXCanvas;
import javafx.scene.Scene;
import javafx.scene.web.WebView;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class JavaFXonSWT
{
public static void main(String[] args)
{
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("JavaFX on SWT");
shell.setLayout(new FillLayout());
FXCanvas fxcanvas = new FXCanvas(shell, SWT.NONE);
WebView view = new WebView();
Scene scene = new Scene(view);
fxcanvas.setScene(scene);
fxcanvas.setVisible(true);
shell.open();
while (!shell.isDisposed())
{
if(!display.readAndDispatch())
{
display.sleep();
}
}
display.dispose();
}
}