0

I am using netbeans 10.

So you know how on netbeans you can either create a jframe form, or you can create a class and make jframe method type of thing? (sorry I dont know my java language). If one was to make a game, which one would you choose? What is each "type of jframe" better for? Like what kind of projects would you use one over the other for? Thank you.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • Maybe start with [this](https://stackoverflow.com/questions/13734069/how-can-i-set-in-the-midst/13734319#13734319); [this](https://stackoverflow.com/questions/16473627/java-jframe-setsizex-y-not-working/16473639#16473639); [this](https://stackoverflow.com/questions/13457237/how-to-get-the-exact-middle-of-a-screen-even-when-re-sized/13460914#13460914) and [this](https://stackoverflow.com/questions/13313084/graphics-rendering-in-title-bar/13316131#13316131) for reasons why I **wouldn't** recommend starting with `JFrame` as your base component – MadProgrammer Mar 12 '20 at 02:47
  • 1
    The `JFrame` should be use purely as a "top level" container for the rest of your solution - the core functionality should then be handled by one or more custom panels (ie `JPanel`) which facilitates the requirements you want to achieve – MadProgrammer Mar 12 '20 at 02:49
  • You might also want to take look at [paintComponent() vs paint() and JPanel vs Canvas in a paintbrush-type GUI](https://stackoverflow.com/questions/12175174/paintcomponent-vs-paint-and-jpanel-vs-canvas-in-a-paintbrush-type-gui/12175819#12175819) – MadProgrammer Mar 12 '20 at 02:50

1 Answers1

0

If you want to create a small game or an example, I think the JFrame is ok. And as this follow, you need 2 important parts:

You can check out the example: Game loop and renderer in game

For the quick look: Jframe glimpse

But if you want to make a game for real life, you need a framework or an engine to do that.

With Java, you can check out Libgdx

With C++, Javascript, Lua you can check out Cocos2d-x

With C#, you can check out Unity

With Javascript only, you can check out Phaserjs

and so on ...

Kong
  • 23
  • 3