Blocking keyboard

I am using LWJGLCanvas inside a swing application and have the following problem:



On GUI creation the AWT Thread is completely blocked and therefore the window is not repainted anymore.



To solve this problem I have put all things from the SimpleCanvasImpl - simpleSetup() in a Callable object and add it to the GameTaskQueueManager.



This solved the repaint problem but now the window is painted but the keyboard is not reacting until the canvas is completely rendered.



Please can anybody give me an advise how to unblock the keyboard as well ?



Here is the JPanel constructor:


ThreeDPanel(Dimension dimension) {
        setLayout(new BorderLayout());
        //String renderer = "LWJGL";
        display = DisplaySystem.getDisplaySystem();
        display.registerCanvasConstructor("AWT", LWJGLAWTCanvasConstructor.class);
        java.util.HashMap<java.lang.String, java.lang.Object> props = new HashMap<String, Object>();
        //props.put(renderer, ui)
        glCanvas = (LWJGLCanvas) display.createCanvas(
                dimension.width, dimension.height);
        display.setVSyncEnabled(true);

        // add a listener... if window is resized, we can do something about it.
        this.addComponentListener(new ComponentAdapter() {

            @Override
            public void componentResized(ComponentEvent ce) {
                doResize();
            }
        });
        //setup keyboard and mouse listener
        KeyInput.setProvider(KeyInput.INPUT_AWT);
        //addKeyListener((AWTKeyInput)KeyInput.get());
        AWTMouseInput.setup(glCanvas, false);
        glCanvas.setDrawWhenDirty(false);
        impl = new SceneImpl(dimension.width, dimension.height);
        glCanvas.setTargetRate(60);
        glCanvas.setImplementor(impl);
        glCanvas.setUpdateInput(true);
        add(glCanvas, BorderLayout.CENTER);
    }



simpleSetup() from SceneImpl:


@Override
    public void simpleSetup() {

        Callable<?> exe = new Callable() {

            @Override
            public Object call() {
                // Normal Scene setup stuff...
                cam.setFrustumPerspective(45.0f, (float) DisplaySystem.getDisplaySystem().getRenderer().getWidth()
                        / (float) DisplaySystem.getDisplaySystem().getRenderer().getHeight(), 1, 1000);
                rotQuat = new Quaternion();
                axis = new Vector3f(1, 1, 0.5f);
                axis.normalizeLocal();
                Callable<?> exeLight = new Callable() {

                    @Override
                    public Object call() {
                        SceneImpl.this.setupLight();
                        return null;
                    }
                };
                GameTaskQueueManager.getManager().getQueue(GameTaskQueue.RENDER).enqueue(exeLight);

                //startTime = System.currentTimeMillis() + 5000;
                input = new InputHandler();
                input.addAction(new InputAction() {

                    @Override
                    public void performAction(InputActionEvent evt) {
                        System.out.println(evt.getTriggerName());
                    }
                }, InputHandler.DEVICE_MOUSE, InputHandler.BUTTON_ALL,
                        InputHandler.AXIS_NONE, false);

                /*input.addAction(new InputAction() {

                    @Override
                    public void performAction(InputActionEvent evt) {
                        System.out.println(evt.getTriggerName());
                    }
                }, InputHandler.DEVICE_KEYBOARD, InputHandler.BUTTON_ALL,
                        InputHandler.AXIS_NONE, false);*/
                Callable<?> exeObjects = new Callable() {

                    @Override
                    public Object call() {
                        SceneImpl.this.addObjects();
                        rootNode.updateRenderState();
                        return null;
                    }
                };
                GameTaskQueueManager.getManager().getQueue(GameTaskQueue.RENDER).enqueue(exeObjects);
                //rootNode.updateRenderState();
                return null;
            }
        };
        GameTaskQueueManager.getManager().getQueue(GameTaskQueue.RENDER).enqueue(exe);
    }



Thank you allot!
cheers,
Clemens