JDK-8181786 : Extra runLater causes impossible states to be possible using javafx.embed.singleThread=true
  • Type: Bug
  • Component: javafx
  • Sub-Component: swing
  • Affected Version: 8,9,10
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2017-06-07
  • Updated: 2020-01-31
  • Resolved: 2017-08-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 8
10 b23Fixed 8u162Fixed
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_141"
Java(TM) SE Runtime Environment (build 1.8.0_141-b11)
Java HotSpot(TM) Client VM (build 25.141-b11, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]

A DESCRIPTION OF THE PROBLEM :
I realize the javax.embed.singleThread=true is "experimental", but it seems to be widely adopted as people start to transition over to JavaFX.

We are setting up some automated GUI testing and we noticed something odd happening.  When we traced it back, it was because an accidental double-click was happening on a button.  This button brought up a modal dialog.

The bug is that, when running with the JavaFX system initialized, there is an extra "run later" happening in the swing event loop.  This allows the modal dialog opening to be delayed one cycle; thereby letting the second click to also trigger the action.  In the attached example, this causes the dialog to be opened twice.

The impact of this bug is that it makes it difficult to transition over to JavaFX since using JavaFX in part of the application causes older parts to be vulnerable since states that were impossible before (e.g. two input dialogs) are now possible.

Occasionally, the following exception occurs:

Exception in thread "JavaFX Application Thread" java.lang.ClassCastException: java.lang.Thread cannot be cast to java.awt.EventDispat
        at java.awt.SequencedEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
...


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile the attached program and run it from the command line like this:
"c:\Program Files (x86)\Java\jre1.8.0_121\bin\java.exe" -Djavafx.embed.singleThread=true -jar dist\JavaFXDoubleClick.jar

Then run it from the command line like this:
"c:\Program Files (x86)\Java\jre1.8.0_121\bin\java.exe" -Djavafx.embed.singleThread=false -jar dist\JavaFXDoubleClick.jar

When the singleThread=true, this will open up two dialogs, but when it is false, the expected result of one dialog will open.
The sleep is included in the test program so that it is easier to reproduce.
In our application it is easily reproducible since we have enough logic surrounding window placement and such that it take takes that extra few milliseconds which allows the error to occur.

The stack trace is listed in https://bugs.openjdk.java.net/browse/JDK-8088132, but the exception is not the problem I want to emphasize.  The major problem is this extra cycle.

The code path is in EventQueue.java.
protected void dispatchEvent(final AWTEvent event) has code to handle the fx dispatcher.  This eventually gets to a call to Platform.runLater() in the SwingFXUtils.FXDispatcher


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Modality would work as expected.  Only one dialog would ever show
ACTUAL -
It is possible to get two modal dialogs

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "JavaFX Application Thread" java.lang.ClassCastException: java.lang.Thread cannot be cast to java.awt.EventDispat
        at java.awt.SequencedEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3$1.run(Unknown Source)
        at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at com.sun.glass.ui.win.WinApplication._enterNestedEventLoopImpl(Native Method)
        at com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(WinApplication.java:218)
        at com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:511)
        at com.sun.glass.ui.EventLoop.enter(EventLoop.java:107)
        at com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:583)
        at javafx.embed.swing.SwingFXUtils$FwSecondaryLoop.lambda$enter$63(SwingFXUtils.java:332)
        at com.sun.javafx.application.PlatformImpl.runAndWait(PlatformImpl.java:317)
        at com.sun.javafx.application.PlatformImpl.runAndWait(PlatformImpl.java:307)
        at javafx.embed.swing.SwingFXUtils$FwSecondaryLoop.enter(SwingFXUtils.java:331)
        at java.awt.Dialog.show(Unknown Source)
        at java.awt.Component.show(Unknown Source)
        at java.awt.Component.setVisible(Unknown Source)
        at java.awt.Window.setVisible(Unknown Source)
        at java.awt.Dialog.setVisible(Unknown Source)
        at javafxdoubleclick.JavaFXDoubleClick.showDialog(JavaFXDoubleClick.java:70)
        at javafxdoubleclick.JavaFXDoubleClick.lambda$new$1(JavaFXDoubleClick.java:48)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.focusLost(Unknown Source)
        at java.awt.Component.processFocusEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
        at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
        at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.SentEvent.dispatch(Unknown Source)
        at java.awt.DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent.dispatch(Unknown Source)
        at java.awt.DefaultKeyboardFocusManager.sendMessage(Unknown Source)
        at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.awt.EventQueue$4.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.SequencedEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3$1.run(Unknown Source)
        at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at com.sun.glass.ui.win.WinApplication._enterNestedEventLoopImpl(Native Method)
        at com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(WinApplication.java:218)
        at com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:511)
        at com.sun.glass.ui.EventLoop.enter(EventLoop.java:107)
        at com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:583)
        at javafx.embed.swing.SwingFXUtils$FwSecondaryLoop.lambda$enter$63(SwingFXUtils.java:332)
        at com.sun.javafx.application.PlatformImpl.runAndWait(PlatformImpl.java:317)
        at com.sun.javafx.application.PlatformImpl.runAndWait(PlatformImpl.java:307)
        at javafx.embed.swing.SwingFXUtils$FwSecondaryLoop.enter(SwingFXUtils.java:331)
        at java.awt.Dialog.show(Unknown Source)
        at java.awt.Component.show(Unknown Source)
        at java.awt.Component.setVisible(Unknown Source)
        at java.awt.Window.setVisible(Unknown Source)
        at java.awt.Dialog.setVisible(Unknown Source)
        at javafxdoubleclick.JavaFXDoubleClick.showDialog(JavaFXDoubleClick.java:70)
        at javafxdoubleclick.JavaFXDoubleClick.lambda$new$1(JavaFXDoubleClick.java:48)
        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3$1.run(Unknown Source)
        at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191)
        at java.lang.Thread.run(Unknown Source)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package javafxdoubleclick;

import java.awt.FlowLayout;
import java.lang.reflect.Method;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

/**
 *
 * @author ocMAClaassen
 */
public final class JavaFXDoubleClick extends JFrame {
	private boolean odd = true;

	/**
	 * @param args the command line arguments
	 */
	public static void main(String[] args) {
		SwingUtilities.invokeLater(() -> new JavaFXDoubleClick());
	}
	private JavaFXDoubleClick() {
		try {
			Class<?> clazz;
			clazz = Class.forName("com.sun.javafx.application.PlatformImpl");
			Method m = clazz.getMethod("startup", Runnable.class);
			Runnable r = new Runnable() {
				@Override
				public void run() {
				}
			};
			m.invoke(null, new Object[]{r});
		}
		catch (Exception ex) {
			ex.printStackTrace();
		}

		JPanel panel = new JPanel(new FlowLayout());
		JButton button = new JButton("Double Click Me");
		button.addActionListener((e) -> showDialog());
		panel.add(button);
		setContentPane(panel);
		panel.setVisible(true);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		setSize(200, 100);
		setVisible(true);
	}
	private void showDialog() {
		System.err.println(System.getProperty("java.version") + " " + System.getProperty("javafx.embed.singleThread"));
		JDialog dialog = new JDialog(this);
		dialog.setModal(true);
		JPanel panel = new JPanel();
		panel.add(new JLabel("Modal Dialog"));
		dialog.setContentPane(panel);
		dialog.pack();
		if (!odd)
			dialog.setLocation(400, 300);
		else
			dialog.setLocation(200, 300);
		odd = !odd;
		sleep(100);
		dialog.setVisible(true);

	}
	private void sleep(int millis) {
		try {
			Thread.sleep(millis);
		}
		catch (InterruptedException ex) {
			ex.printStackTrace();;
		}

	}
}

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

SUBMITTED WORKAROUND :
We have a utility that we use to create our buttons, which gave us an opportunity to surround the actionPreformed call to be wrapped in a try / finally block that can keep a flag preventing the subsequent calls from actually doing anything.  However, this doesn't feel like a very satisfying solution


Comments
Lookg good to me. +1
29-08-2017

Sorry, forgot about backporting, please review the JDK only fix http://cr.openjdk.java.net/~azvegint/jdk/10/8181786/02/
16-08-2017

What will the behavior be of running with the FX fix, but not the JDK fix? What about the other way around? A quick look at the webrevs suggest that this will fail to build since a signature of a method in JDK that is overridden by FX has changed. This is a problem for two reasons: A) We still use JDK 9 as the bootjdk for build / test of FX 10. B) We build separately and cannot rely on both changes being in the same build -- even when we start using JDK 10 as boot jdk we will use jdk-10 build N-1 to build FX for build N.
10-08-2017

ok. +1
10-08-2017

Sure, I did a sanity testing on all platforms. BTW, the same issue was observed on Linux too.
10-08-2017

Fix works ok in windows. Looks good to me. Just to be on safe side to see if this does not cause any regression, has this fix been tested in linux or mac where this issue is not seen?
10-08-2017

Fix In Progress
01-08-2017

http://cr.openjdk.java.net/~azvegint/jdk/10/8181786/01/ Normally second Action listener is discarded by ModalEventFilter, but current single thread implementation doesn't take into account filter provided by dialog. With singleThread option we are dispatching events to the JavaFX Application Thread, so we have some delay between events posted on AWT side and its processing on JavaFX Application Thread. Currently I don't see a straight forward way to implement filtering mechanism entirely, so I suggest to apply filters upon entering nested event loop, and filter out events before dispatching they on JavaFX Application Thread.
01-08-2017

IIUC this issue only happens with dialogs, other valid scenarios will be broken after this fix, e.g. if user would like to count mouse clicks, or send some network packet on click, etc.
24-07-2017

Request to review the fix http://cr.openjdk.java.net/~psadhukhan/8181786/webrev.00/
21-07-2017

This problem is specific to windows. Tried on mac where the issue is not reproducible.
13-07-2017

The following modifications fixes this issue. FXDispatcher is the only known implementation for "fwDispatcher" and fwDispatcher.scheduleDispatch() calls Platform.runLater() which invokes dispatchEventImpl() as can be seen below with Mouse Release event with clickCount 2. It calls JComponent.processMouseEvent() which calls BasicButtonListener.mouseReleased() which calls AbstractButton.fireActionPerformed() which then triggers test application's button.addActionListener((e) -> showDialog()); code I do not see clickCount > 1 for singleThread=false and also when I run this app in jdk, it is always 1. I do not have much knowledge of javafx.embed.singleThread feature to propose a better solution at this moment. hg diff src/java.desktop/share/classes/java/awt/EventQueue.java *** failed to import extension trees from ~/trees.py: 'module' object has no attribute 'norepo' diff -r d23d309ef85a src/java.desktop/share/classes/java/awt/EventQueue.java --- a/src/java.desktop/share/classes/java/awt/EventQueue.java Tue Jun 06 10:58:02 2017 +0530 +++ b/src/java.desktop/share/classes/java/awt/EventQueue.java Thu Jun 29 12:28:27 2017 +0530 @@ -709,11 +709,15 @@ // dispatch thread (e.g. performing DefaultKeyboardFocusManager.sendMessage), // dispatch the event straight away. if (fwDispatcher == null || isDispatchThreadImpl()) { dispatchEventImpl(event, src); } else { fwDispatcher.scheduleDispatch(new Runnable() { @Override public void run() { + if (event instanceof MouseEvent && ((MouseEvent)event).getClickCount() > 1) + return; dispatchEventImpl(event, src); } });
29-06-2017

In FX, AbstractButton.fireActionPerformed is called for BasicButtonListener.mouseReleased and BasicButtonListener.focusLost (as per the stacktrace) and since the app register any action with showDialog via button.addActionListener((e) -> showDialog()); it is showing dialog twice. But during debugging, I find that dialog is shown twice because BasicButtonListener.mouseReleased is called twice. focusLost() is also called but it returns from DefaultButtonModel#setPressed without calling actionPerformed() if((isPressed() == b) || !isEnabled()) { return; } so its strange why stacktrace is saying actionPerformed is called from focusLost() In swing for same testcase, AbstractButton.fireActionPerformed is called for BasicButtonListener.mouseReleased one time only and also BasicButtonListener.focusLost returns from if((isPressed() == b) || !isEnabled()) { return; } so only 1 dialog is shown.
27-06-2017

Could reproduce with jdk9-ea172.
09-06-2017

Update from CAP member: Would you mind adding a note saying that I accidently included the stack trace from a previous release of Java. Here is the stack trace from U141 Exception in thread "JavaFX Application Thread" java.lang.ClassCastException: java.lang.Thread cannot be cast to java.awt.EventDispatchThread at java.awt.SequencedEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3$1.run(Unknown Source) at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._enterNestedEventLoopImpl(Native Method) at com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(WinApplication.java:218) at com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:511) at com.sun.glass.ui.EventLoop.enter(EventLoop.java:107) at com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:583) at javafx.embed.swing.SwingFXUtils$FwSecondaryLoop.lambda$enter$63(SwingFXUtils.java:332) at com.sun.javafx.application.PlatformImpl.runAndWait(PlatformImpl.java:317) at com.sun.javafx.application.PlatformImpl.runAndWait(PlatformImpl.java:307) at javafx.embed.swing.SwingFXUtils$FwSecondaryLoop.enter(SwingFXUtils.java:331) at java.awt.Dialog.show(Unknown Source) at java.awt.Component.show(Unknown Source) at java.awt.Component.setVisible(Unknown Source) at java.awt.Window.setVisible(Unknown Source) at java.awt.Dialog.setVisible(Unknown Source) at javafxdoubleclick.JavaFXDoubleClick.showDialog(JavaFXDoubleClick.java:75) at javafxdoubleclick.JavaFXDoubleClick.lambda$new$1(JavaFXDoubleClick.java:51) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.focusLost(Unknown Source) at java.awt.Component.processFocusEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.SentEvent.dispatch(Unknown Source) at java.awt.DefaultKeyboardFocusManager$DefaultKeyboardFocusManagerSentEvent.dispatch(Unknown Source) at java.awt.DefaultKeyboardFocusManager.sendMessage(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.SequencedEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3$1.run(Unknown Source) at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._enterNestedEventLoopImpl(Native Method) at com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(WinApplication.java:218) at com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:511) at com.sun.glass.ui.EventLoop.enter(EventLoop.java:107) at com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:583) at javafx.embed.swing.SwingFXUtils$FwSecondaryLoop.lambda$enter$63(SwingFXUtils.java:332) at com.sun.javafx.application.PlatformImpl.runAndWait(PlatformImpl.java:317) at com.sun.javafx.application.PlatformImpl.runAndWait(PlatformImpl.java:307) at javafx.embed.swing.SwingFXUtils$FwSecondaryLoop.enter(SwingFXUtils.java:331) at java.awt.Dialog.show(Unknown Source) at java.awt.Component.show(Unknown Source) at java.awt.Component.setVisible(Unknown Source) at java.awt.Window.setVisible(Unknown Source) at java.awt.Dialog.setVisible(Unknown Source) at javafxdoubleclick.JavaFXDoubleClick.showDialog(JavaFXDoubleClick.java:75) at javafxdoubleclick.JavaFXDoubleClick.lambda$new$1(JavaFXDoubleClick.java:51) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3$1.run(Unknown Source) at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$148(WinApplication.java:191) at java.lang.Thread.run(Unknown Source)
08-06-2017

Verified and its reproducible in both JDK 8 and 9 (using --add-exports javafx.graphics/com.sun.javafx.application=ALL-UNNAMED) Windows 10 (64-bit) ============== 8 GA : FAIL 8u60 : Fail 8u131 : Fail 8u152 : Fail 9-ea+110 : Fail 9-ea+173: Fail
08-06-2017