How do I pass parameters from the calling function to the applet?

I try to start simpleApplication applet using deployJava.runApplet(attributes, parameters, version);

How do I pass the parameters to the simpleInitApp?

The only thing you need to pass is the “AppClass” parameter which is the class that extends Application that will be loaded by the AppletHarness

I need to define and pass additional parameters to have the applet do different things based on the parameter value. I have two problems.

One is I can see the parameters are passed and printed in debug environment but not when I pass them using deployJava.runApplet.



Second is I can not pass them forward to the simpleinitApplication from the static main.



What should I do?

Have you tried using AppletHarness.getApplet()?

I tried AppletHarness.getApplet() but it returns null.



public void simpleInitApp() {

Applet a = AppletHarness.getApplet(app);





app above is a class of type Simpleapplication.



Is there an example use of ApppletHarness?



When you check the Applet box in JME, does it wrap the Simple Application with applet Harness?

Is the applet you’re running is AppletHarness or something else?

And yes, when you check that box in jME SDK it will run the app with AppletHarness

I tried both. No luck. I also tried to look at the JME library to find out the order of instantiation of classes when applet is checked. Still trying to understand. When the Applet box is checked:

Is the AppletHarness top class in the hierarchy?

Where does the main function go in this case?

Can you show me the exact code that is added on top of my Application class when I checked the Applet box?



Thanks for the help

@junkstuff0 said:
I tried both. No luck. I also tried to look at the JME library to find out the order of instantiation of classes when applet is checked. Still trying to understand. When the Applet box is checked:
Is the AppletHarness top class in the hierarchy?
Where does the main function go in this case?
Can you show me the exact code that is added on top of my Application class when I checked the Applet box?

Thanks for the help

Your application class is wrapped by the AppletHarness class:
http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/desktop/com/jme3/app/AppletHarness.java