So I was programming a bit on a Game Engine and have a JFrame and Canvas. Everything and all worked absolutely fine until I added a JPanel as Contentpage to my JFrame using setContentPage(JPanel).
I did this to use Keybindings in my JFrame because and now all of a Sudden my Canvas throws a "java.lang.IllegalStateException: Component must have a valid peer" Exception at the point where I try to use Canvas.createBufferStrategy.
I have no idea why and it only started after I added the setContentPage to my code. Google doesnt return an Answer as does SO.