Have to click before pressing key
问题 I've finally managed to get my GraphicsProgram in java to remove a certain GObject when the spacebar is pressed. This is the code: public void keyPressed(KeyEvent key){ int space = key.getKeyCode(); if (space == KeyEvent.VK_SPACE){ remove(welcome); } } The problem is that if I start my program, it will not recognize that I am inside the GraphicsWindow program that starts up. (This is somewhat difficult to explain) Basically, I first have to click inside the window, before it will recognize