java - Ctrl mask passing from mouse event to action performed -
in code have menu item action attached action map (menuitem.setactionname("somestring")
).
in action map, values, have objects of classes extends abstractaction
, implemented actionperformed
method. problem is, how pass modifiers mouse event (mouse released when clicked on menuitem
) actionperformed
? have check if action or without ctrl called in actionperformed
method. information modifiers in mouseevent
, call stack shows doclick
on menu item called, invokes actionperformed
(through setpressed
). in moment, information modifiers mouseevent
aren't passed needed information lost.
thanks!
try overwriting processmouseevent
on class extending jmenuitem
. can modifier mouseevent
@ processmouseevent
method.
Comments
Post a Comment