Bear with me as I am not well versed in how Applets work in java. I have created a video game that runs in an applet, with other game object classes and image files in the package directory. I want to create an executable .jar to run the applet, but eclipse is asking for a launch configuration, so I assume I would need another class that deals with initializing the applet and anything else the applet might need.
How would I go about doing this?
Those are two different concepts:
So basically you have to decide, what is important to you:
Applets are Panels (see Applet class extends Panel) that provide a particular life-cycle so that you can attach them to the web-browser and the browser triggers life-cycle methods. If you want to run an applet outside a web-browser you need to provide another "window" to attach it to and a way to trigger life-cycle's methods.
You can have a normal java Frame as "main window" and add the applet to it. Then call applet's init method to start it.
For a more fine grained management of applet's life-cycle you'd probably want to write your own AppletContext.
See my answer here for a basic example (this one uses JApplet but the concept is the same for Applet): Java JApplet to JFrame
Hope it can help.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.