KeyListener CMD+W

Posted by Alexander Haid on
URL: http://imagej.273.s1.nabble.com/KeyListener-CMD-W-tp3690923.html

Hi all!

I am programming my own plugin in java. I am using a JDialog window to
display all the buttons, etc.
 
Now I wanted to add a small, but useful function to my plugin: that the user
is able to close the plugin dialog with the common key shortcuts - under mac
osx CMD+w or windows CTRL+w.

Already read the programming example about Key Listeners
(http://rsbweb.nih.gov/ij/plugins/key-listener.html). But could not figure
out how to fetch combinded key-strokes like the ones I wannt to act on? Can
someone tell me how to do that the best way?

Thanks,
 - alex