I have a question as to whether this is considered bad programming. My applet game was supposed to be small but has grown into something much larger. I wanted to make it a standalone application without changing my code, so I stuck the applet in the center panel of a JFrame. Is this a bad choice? Does it affect performance of the applet? Any advice would be great, thanks guys!
I mean I would use a JApplet if you are going to use Swing as a frame. Swing (JFrame/JApplet) is lightweight and AWT (Frame/Applet) is heavyweight. You don’t want to mix the two different types together.
Ok thanks for the info. Would it still be frowned upon to put a JApplet inside a JFrame as an easy way to make the program into an application?
Ignoring the fact that applets are now dead and hard to deploy to many users, you can just do it. I did it in the early stages to allow my game to be run as both an applet and an application. What I did was extend my Game class from JApplet, and then simply added it to the JFrame with null layout when run as an application.
Do note that these are over three years old, and uses my horrible coding skills.
This is awesome, thanks for the examples. Good to know that this is an acceptable practice.