Skip to main content

Canvas request focus in a JAR

No replies
sproketboy
Offline
Joined: 2006-08-07
Points: 0

Hi all,

For some reason my game runs fine from the IDE but in a jar the requestFocus does not work. j3d 1.5.2 on windows xp 32 bit.

My game has several panels and some have key events associated with them. So when I want the java3d canvas to work with the keyboard I use:

mazePanel.grabFocus();
mazePanel.getCanvas3D().requestFocus();

for some reason this doesn't work in the jar. I have to click the canvas to make it work.

I also tried:
mazePanel.getCanvas3D().requestFocusInWindow();

any ideas?

TIA