Kevin,

I also had the problem you mention about keyboard accelerators not
working after mouse interaction with the canvas.  It is a focus issue as
far as I can tell.  I worked around this issue using requestFocus() for
the content pane, to get focus back from the canvas after every mouse
click.  It's not really clean, but it works.  I'm not sure if this is
intended behaviour or a bug, but I submitted it nonetheless.  

Attach a FocusListener to the canvas3D and this is the method to regain
keyboard control:

public void focusGained(FocusEvent e) {
        if (e.getSource() == getCanvas3D()) 
            getContentPane().requestFocus();
}

This solved my problem for accelerators and also mnemonics for the
JMenuBar items - they always work now.

Christopher


-----Original Message-----
From: Copps, Kevin D [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 9:16 PM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] mixing Swing w/ Java3D


I realize the issues of mixing lightweight and heavyweight components,
however, I am seeing what is possible...

Can a canvas 3D work as one half of a Swing JSplitPane? I've tried it
and I
can slide the splitter to make the canvas bigger, but not smaller. I'd
like
to have a JTree as the other half, and the user may want to slide the
split
pane so as to have more room to read the tree nodes.

The other problem I have is when using JMenu's with keyboard
accelerators.
Once I do some mouse interaction with Java3D objects in the canvas, the
key
accelerators no longer work. I guess I may need to forward the
keystrokes
from the Java3D context back to the main frame. Is there a good place to
look for more information about this?

--Kevin

========================================================================
===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff JAVA3D-INTEREST".  For general help, send email
to
[EMAIL PROTECTED] and include in the body of the message "help".

==========================================================================To 
unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to