-1

So what's the best practice, use a JFrame as the one that contains the main method, or just create a main class, and call the JFrame?

I'm not sure it matters at all, but i'm wondering if there are any advantages using the main in JFrame class or not?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Peter
  • 35
  • 4
  • 1
    This will answer your question, https://stackoverflow.com/questions/5473828/java-swing-gui-best-practices-from-a-code-standpoint ! – dhanu10896 Feb 03 '19 at 11:27

1 Answers1

0

I personally try to keep the main method in its own class because maybe you want to do more than just start the JFrame at startup.

But that really depends on what you want to do, if you only want to start the JFrame then the main method in the JFrame is also good.

You may also want to have a look at this post

Flo
  • 161
  • 1
  • 6