Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8247163: JFXPanel throws exception on click when no Scene is set #248

Changes from all commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.


Just for now

@@ -449,8 +449,10 @@ protected void processMouseEvent(MouseEvent e) {
// The extra simulated mouse pressed event is removed by making the JavaFX scene focused.
// It is safe, because in JavaFX only the method "setFocused(true)" is called,
// which doesn't have any side-effects when called multiple times.
int focusCause = AbstractEvents.FOCUSEVENT_ACTIVATED;
stagePeer.setFocused(true, focusCause);
if (stagePeer != null) {
int focusCause = AbstractEvents.FOCUSEVENT_ACTIVATED;
stagePeer.setFocused(true, focusCause);

@@ -137,5 +137,23 @@ public void testNoDoubleClickOnFirstClick() throws Exception {

Assert.assertEquals(1, pressedEventCounter[0]);

public void testClickOnEmptyJFXPanel() throws Exception {
CountDownLatch firstPressedEventLatch = new CountDownLatch(1);

SwingUtilities.invokeLater(() -> {
TestFXPanel fxPnl = new TestFXPanel();

MouseEvent e = new MouseEvent(fxPnl, MouseEvent.MOUSE_PRESSED, 0, MouseEvent.BUTTON1_DOWN_MASK,
5, 5, 1, false, MouseEvent.BUTTON1);



Assert.assertTrue(firstPressedEventLatch.await(5000, TimeUnit.MILLISECONDS));

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.