Preventing NewtCanvasAWT from gaining focus?
Posted by enzio on Jul 16, 2013; 11:59pm
URL: https://forum.jogamp.org/Preventing-NewtCanvasAWT-from-gaining-focus-tp4029605.html
Let me start by explaining what I am trying to do, as I think this may be helpful in understanding the what I am really trying to achieve with the focus...
I have the canvas rendered in front of a JDesktopPane on which I have swing components rendered. So, the canvas completely obscures the swing components. I paint the swing components to buffered images and render the images as textures on the canvas in order to allow 3D transformations on the images. Any mouse and keyboard events which occur can then be translated and dispatched to the swing component to allow interaction with it. This seems to work fine, but I am running into a problem with drag and drop operations (this may also occur with other operations, but drag and drop is the one of which I am aware). The problem is that as the drag begins the NewtCanvasAWT gains the focus so the dragged component loses focus. When the translated MOUSE_DRAGGED event is delivered, the component regains focus, but the drag action will already be terminated.
Is there any way prevent the canvas from gaining the focus?
Also, I am very open to any other approach to this problem, so any suggestions on alternate approaches are welcome.
Thanks in advance.