Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JavaFX menu button

awacs5Mar 27 2017 — edited Mar 28 2017

Hi,

I'm developing an application toolbar and I would like to change the click behaviour of the menu button. So basically I'd like the menu button to open when the user clicks on it and stay open until the user clicks on it again (second click on it will close it).

So I started off by adding a mouse click eventfilter to the menu button. This all seems to work good, but when I click somewhere else on the screen (not on the menu) the menu will auto close. The mouse event filter is not triggered when I click somewhere else. How can I keep the menu open until the user clicks on it a second time?

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 25 2017
Added on Mar 27 2017
2 comments
655 views