# Do you extend Java, to make games, or can you just use JFrame?

I'm starting to create my own side scroller, in Java. I think I've read that, when you create a game in Java, there is something you can extend your class with, like GamePanel.

Is this true, or can you just use JFrame for your Java games?

• Can we have more information about the game? For example, if you are using JOGL or Java3D for rendering, then those would have specific requirements for what you can draw to. If you're doing a 2D game and not using any libraries (i.e. overriding paintComponent()), then I guess pretty much any Swing component would work and a bunch of event listeners, but I wouldn't think that would be the most performant piece of code. – PatrickB Aug 15 '11 at 3:54
• Alright! At the moment i am not using any libraries for my game.. But if i should which library is good you think? – TheCompBoy Aug 15 '11 at 6:26
• If you're going without libraries (which IMHO isn't neccessarily a bad thing) take a look at BufferStrategy: docs.oracle.com/javase/7/docs/api/java/awt/image/… – Steve Smith Jun 13 '17 at 11:41