Swing MenuEvent menuCanceled
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.
精彩评论