Component must have a valid peer - BufferStrategy
问题 First off all, I know questiones like this has been asked before, but no answers seem to fix my problem. I am working on a little game, and for some reason java returns an IllegalStateException whenever I try to create a new bufferstrategy. I am adding the game to a JFrame, but the exception is still thrown, here is the code for adding to the JFrame: JFrame frame; public Window(int x, int y, int width, int height, String title, boolean focus, Main game) throws IOException { frame = new JFrame