brandonborkholder / glg2d

Graphics2D wrapper for JOGL
77 stars 31 forks source link

Re: JPopMenu is not triggered & displayed on GLG2DCanvas component #31

Open chinnaswamyg opened 8 years ago

chinnaswamyg commented 8 years ago

Hi All, I could successfully made use of GLG2D library to my java2D application with all existing Mouse Listeners and Mouse Motion Listeners (of Java2D application) added to GLG2DCanvas component . In that, I also have a MousePopupListener added to GLG2DCanvas component for triggering the popping up of a JPopupMenu when mouse right button is pressed.. When I pressed the mouse right button as per the method in MousePopupListener, there was no display of JPopupMenu although I have already added, "JPopupMenu.setDefaultLightWeightPopupEnabled(false);" in the constructor . The same Mouse Popup Listener is working well when added to JPanel added to the contentPane of JFrame.

When I tried to debug at the lines of MousePopupLisneter,when added to GLG2DCanvas the program execution does not even reach the mousePressed method.

Request for your advice to resolve this issue.

Thanks in advance.

Chinnaswamy, Singapore

brandonborkholder commented 8 years ago

This is an unfortunate issue with GLG2DCanvas. GLG2DCanvas is faster in painting than GLG2DPanel but it does not respond to mouse events properly. I recommend you use GLG2DPanel instead. It should be a drop-in replacement for GLG2DCanvas and respond to mouse events.