Testing and deploying applets
You can test an applet using launch configuration options before deploying it to open in a browser.
An applet is a bean that is designed to be run inside a Web browser and that inherits from java.applet.Applet or javax.swing.JApplet .
The Eclipse-based launcher has its own applet stub that is used to run the applet. This stub automatically starts the applet after it has been instantiated by calling its start() method. Unlike the JRE applet launcher, which the Java bean launcher does not use, the stub does not check authority profiles to see whether the applet can perform tasks such as input/output or opening sockets. This means you can quickly test your applet's run-time appearance and behavior without worrying about security certificates.
To test an applet using the Java bean launcher:
- Create a launch configuration for your applet class. See Configuring options for running a Java bean or application for more information.
- On the Applet Parameters page of the launch configuration, specify any parameters that you want to pass to the applet. These parameters will be made available to the applet under test by means of a call to the getParameter(String) method.
- Click the New button to add a new parameter.
- To edit the values for the Name and Value of the parameter, select the text in the table and type new values.
- Click Apply to save the launch configuration.
- Click Run to run the applet using the parameters that you entered.
When you have finished testing your applet and are ready to deploy it in a browser, you can use the simple HTML <applet> tag, as long as the class does not require any JDK 1.2 or higher features, such as any of the Swing classes. If your applet uses any JDK 1.2 or higher features, the HTML syntax to embed it into a page is more complex in order to deal with differences between browsers and to ensure that the applet uses the correct Java plug-in. For more information about applets and Java plug-ins, refer to java.sun.com.
Parent topic
Testing and debugging in the visual editor
Related tasks
Running a Java bean or application
Configuring options for running a Java bean or application
Testing and debugging in the visual editor
Debugging a visual Java bean or application