简体   繁体   中英

How to know context of the ContextMenu in JavaFX?

Context menu, is, by definition, a menu, called against some context.

Unfortunately, I can't see any means to obtain this context in ContextMenu . Is this really impossible?

from my current understanding of what you want, you can not do that really

but try these

ContextMenu.getOwnerNode();
ContextMenu.getOwnerWidnow();

aside from that it has a userData so i guess, you could pass your "context" there

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM