Running an Applet from an HTML Page

Thanks for using this pre-release version of Visual J++.

This procedure continues to add to the applet project created in the topic, Building a Java Applet with the Applet on HTML Template. If you have not created a project with the Applet template, please do so before continuing with the next steps.

If you have a project created with the Applet on HTML template and it is not open, please open it now. See Opening an Existing Visual J++ Project for the procedure to open this project.

After you have either created a new applet project or opened an existing project, a collapsed view of your project appears in the Project Explorer.

To run your applet from an HTML page

  1. In the Project Explorer, expand the project icon.

  2. Double click your projectÆs .html file.

    The HTML editor opens in the Design tab with your projectÆs applet displayed.

  3. To run your applet in a Web browser from the HTML page, open the Settings dialog box by clicking Settings on the Project menu.

  4. Select the Launch tab.

  5. Click the Default groupÆs radio button.

  6. Select your projectÆs .html page from the When project runs, load: drop-down list box.

    Notice the Default groupÆs Program: text box contains IExplore.exe with appropriate settings in the Arguments: text box.

    Note   To run your applet with a different browser, select the Other Executable groupÆs radio button and type the name of the browser and its arguments in the respective editable text boxes.

  7. Click OK.

  8. On the Debug menu, click Start.

    Your Web browser launches, loads your html page, and displays your applet.