Jglwindow focus challenges

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

Jglwindow focus challenges

imakerobots
Hi!

I have a split view with a jglpanel on the left and some swing components on the right.  

Stewart Platform Simulator

Some user actions create a modal dialog.  When the dialog would close focus would not return to the jglwindow.  I tried

        // focus not returning after modal dialog boxes
        // http://stackoverflow.com/questions/5150964/java-keylistener-does-not-listen-after-regaining-focus
        frame.addFocusListener(new FocusListener(){
            public void focusGained(FocusEvent e){
                //System.out.println("Focus GAINED:"+e);
            }
            public void focusLost(FocusEvent e){
                //System.out.println("Focus LOST:"+e);

                // FIX FOR GNOME/XWIN FOCUS BUG
                e.getComponent().requestFocus();
            }
        });

Which works fine ...until I put jtextfields in the right-hand view, and now I can't type in the fields because focus is jailed to the jglwindow all the time.  When I click on the jtextfield the cursor immediately disappears.

Please: What's the better way to solve this?

Thank you!

The code is here: https://github.com/MarginallyClever/rotarystewartplatform2

PW: WASDQE to fly around, RFTGYHUJIK to move the platform.  The goal is to make precision movements with the text fields and a "go" button.
Reply | Threaded
Open this post in threaded view
|

Re: Jglwindow focus challenges

gouessej
Administrator
Please check whether it is reproducible even with a canvas not using JOGL. I suspect that it is a pure Swing problem once again.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jglwindow focus challenges

imakerobots
I believe you are correct.  I see no reason why JOGL has to be involved.  I guess I posted here to also give you a status update on my project?
Reply | Threaded
Open this post in threaded view
|

Re: Jglwindow focus challenges

gouessej
Administrator
It's ok for me, I just want to make things clear. Actually, when you call requestFocus(), you can't be sure that it will always work and some components can still "steal" the focus.

I'll probably use some of your STL files to test our STL importer in JogAmp's Ardor3D Continuation, thanks.

Edit.: Her/his fix shouldn't be used everywhere, I don't reproduce this bug under Mageia Linux 4 with KDE 4. It would be better to fix this bug directly in OpenJDK.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Jglwindow focus challenges

imakerobots
sure.  if you leave the STL files in the package for future testing, please give attribution.

On Mon, Mar 23, 2015 at 2:54 AM, gouessej [via jogamp] <[hidden email]> wrote:
It's ok for me, I just want to make things clear. Actually, when you call requestFocus(), you can't be sure that it will always work and some components can still "steal" the focus.

I'll probably use some of your STL files to test our STL importer in JogAmp's Ardor3D Continuation, thanks.


If you reply to this email, your message will be added to the discussion below:
http://forum.jogamp.org/Jglwindow-focus-challenges-tp4034169p4034186.html
To unsubscribe from Jglwindow focus challenges, click here.
NAML



--
Dan Royer :: Marginally Clever :: Raising Robot Literacy :: +1.604.916.2281
Reply | Threaded
Open this post in threaded view
|

Re: Jglwindow focus challenges

gouessej
Administrator
imakerobots wrote
sure.  if you leave the STL files in the package for future testing, please
give attribution.

On Mon, Mar 23, 2015 at 2:54 AM, gouessej [via jogamp] <
[hidden email]> wrote:

> It's ok for me, I just want to make things clear. Actually, when you call
> requestFocus(), you can't be sure that it will always work and some
> components can still "steal" the focus.
>
> I'll probably use some of your STL files to test our STL importer in
> JogAmp's Ardor3D Continuation, thanks.
> Julien Gouesse | Personal blog <http://gouessej.wordpress.com> | Website
> <http://tuer.sourceforge.net> | Follow me on Identi.ca
> <http://identi.ca/gouessej>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
> http://forum.jogamp.org/Jglwindow-focus-challenges-tp4034169p4034186.html
>  To unsubscribe from Jglwindow focus challenges, click here
> <http://forum.jogamp.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4034169&code=ZGFuQG1hcmdpbmFsbHljbGV2ZXIuY29tfDQwMzQxNjl8MTM4NTU0NTc0MQ==>
> .
> NAML
> <http://forum.jogamp.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>



--
Dan Royer :: Marginally Clever <http://www.marginallyclevergroup.com/> ::
Raising Robot Literacy :: +1.604.916.2281
Yes, of course, I always do so as you can see here:
http://svn.code.sf.net/p/tuer/code/pre_beta/NOTICE.txt
Julien Gouesse | Personal blog | Website