Swing and keyInput problem

Hey all,

I’m trying to use canvas in jme2, when I use canvas without swing, all is ok.

But problem is when I use canvas with swing like in JMESwingTest

(http://code.google.com/p/jmonkeyengine/source/browse/trunk/src/jmetest/util/JMESwingTest.java)

and I add sth in update function:



[java] public void simpleUpdate() {



if (KeyInput.get().isShiftDown())

{

System.out.println(“shift is down”);

}

…[/java]



This work properly only if canvas is active (after I click on this);/

I tried make JFrame listener but this isn’t good, becouse it only react on

event, and this isn’t look as good as in simplegame. I need list keys every update.

Please help

any ideas?