protected void bindDestination(Application application, Component destination) {

        if (!EventQueue.isDispatchThread()) {
            throw new RuntimeException("bind has to be done from the Event Dispatching thread.");
        }

        if (isMain()) {

            if (application.getContext() != null) {
                if (application.getContext() instanceof AWTContext) {
                    AWTContext context = (AWTContext) application.getContext();
                    AWTMouseInput mouseInput = context.getMouseInput();
                    mouseInput.bind(destination);
                    AWTKeyInput keyInput = context.getKeyInput();
                    keyInput.bind(destination);

                    setDestination(destination);
                    bindListeners();

                    notifyComponentResized(getDestinationWidth(), getDestinationHeight(), isPreserveRatio());

                } else {
                    throw new IllegalArgumentException("Underlying application has to use AWTContext (actually using "+application.getContext().getClass().getSimpleName()+")");
                }
            } else {
                throw new IllegalArgumentException("Underlying application has to use a valid AWTContext (context is null)");
            }
        }
    }
Bind this processor.

@param application the application.
@param destination the destination.
jme3-desktop/src/main/java/com/jme3/system/AWTFrameProcessor.java