If JPopUpMenu is shown, the key/mouseListener wont listen anything

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

If JPopUpMenu is shown, the key/mouseListener wont listen anything

elect
So, if I show a JPopUpMenu my glWindow I guess is losing focus and then I cannot track anymore any further mouse/key events..

What do you think is the best solution to that?

I would like to "forward" somehow if possible the events to the listener attached to the glWindow
Reply | Threaded
Open this post in threaded view
|

Re: If JPopUpMenu is shown, the key/mouseListener wont listen anything

gouessej
Administrator
Hi

Your guess is correct. You can attach some listeners on the Swing popup menu, use one of our classes to create a NEWT event from an AWT event and pass it to NEWT. Look at how NewtCanvasAWT is implemented, it's a good source of inspiration.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: If JPopUpMenu is shown, the key/mouseListener wont listen anything

elect
gouessej wrote
Look at how NewtCanvasAWT is implemented, it's a good source of inspiration.
Uhm.. which one exactly do you mean? Could you link it please?

However my main problem at the moment is that I can't get the JPopUpMenu acquiring focus
Reply | Threaded
Open this post in threaded view
|

Re: If JPopUpMenu is shown, the key/mouseListener wont listen anything

gouessej
Administrator
Reply | Threaded
Open this post in threaded view
|

Re: If JPopUpMenu is shown, the key/mouseListener wont listen anything

elect
What about instead adding a listener on the glWindow regarding a focus lost?