开发者

Swing MenuEvent menuCanceled

开发者 https://www.devze.com 2023-01-17 11:23 出处:网络
I don\'t understand when menuCanceled is invoked on a JMenu. In fact when 开发者_开发技巧I open a menu is called menuSelected when I close a menu is called

I don't understand when menuCanceled is invoked on a JMenu.

In fact when 开发者_开发技巧I open a menu is called menuSelected when I close a menu is called menuDeselected but never will be called menuCanceled.

Any examples?


You are right that MenuListener#menuCanceled is called from JMenu#fireMenuCanceled but the latter doesn't seem to be called anywhere from Windows JDK6.

It could be there for historical reasons or some other platform LAFs, and you have to implement it anyway, so just call menuDeselected from it.

0

精彩评论

暂无评论...
验证码 换一张
取 消