
这是解决该问题的魔术路线:
UIManager.put("PopupMenu.consumeEventOnClose", Boolean.FALSE);在查看BasicPopupMenuUI类的源代码后,我发现了这一点。显然,根据代码中的以下注释,此行为是有意的设计选择,但对我来说确实感觉像是个错误。
// Ask UIManager about should we consume event that closes // popup. This made to match native apps behaviour.
顺便说一下,它也发生在Java 5和6中。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)