Applet Wizard

The Applet Wizard creates an applet consisting of two files and adds them to the existing project. (If no project is open, JBuilder runs the Project Wizard first before it runs the Applet Wizard.)

The Applet Wizard creates the following two files:

Step 1 of 2

Applet Class

The wizard displays default names for the package and applet class file.
Package
This field displays the package name derived from the project file. To assign a different package name to the applet class file, click in the Package field and type in a new name.

For more information on packages, see Packages in Creating and managing projects.

Class
This field displays the default name assigned to the applet class. To rename it, click in the Class field and type in a new name.
File
The full path and .java file name for the applet class is displayed here. This file path and name is constructed from the source path node under which the project exists, plus the contents of the Package and Class fields. This field is not editable. If the path or name are not correct, edit the Package and Class name fields on this page of the wizard. The file will be created with the actual location and name indicated here.

Applet Style

Generate header comments
Check this to use information from the project file as header comments at the top of the applet class file. This is the information entered in the Project Wizard when creating the project file.
//Title:      Your Product Name
//Version:    
//Copyright:  Copyright (c) 1997
//Author:     Your Name
//Company:    Your Company
//Description:Your description
Can run standalone
Check this to create a main() method in the applet file so it can be run alone for testing without being called from an HTML page.
Generate standard methods
Check this to create the standard applet methods: show(), close(), and dispose().


Step 2 of 2

Applet parameters

The grid on this page is used to enter the information that defines the parameters for your applet. This information will generate PARAM tags within the APPLET tag of the new HTML file, and parameter-handling code in the new applet java file.

Fill in one row of the grid for each parameter you wish to have.

Name
Enter a name for the parameter. This will be used to provide the NAME attribute in the PARAM tag in the HTML file, and to provide the name parameter of the corresponding getParameter() call in the Java source.
Type
Enter the type of variable that will be inserted into the Java source code of your applet for holding the value of the parameter coming in from the HTML page.
Desc
Enter a brief description of the parameter. This will be used to describe the parameter when external tools query the applet for what parameters it supports. An example of such a tool is the Applet|Info browser in AppletViewer. (JBuilder runs and debugs applets in AppletViewer.)
Variable
Enter the name of the variable that will be inserted into the Java source code of your applet for holding the value of the parameter coming in from the HTML page.
Default
Enter the default value for the parameter. This is the value that the Java source code in this applet will use if some future HTML file that uses this applet has no PARAM tag for this parameter. For an HTML file to provide this parameter, the NAME attribute in the PARAM tag must exactly match what you've entered in the Name column in this row of the grid. Note that this matching is case sensitive.


Step 3 of 3

HTML Page

This page of the wizard controls the generation of the HTML page that will be inserted into your project for testing this applet. It controls all aspects of the HTML file and its APPLET tag, except for the parameters, which are controlled in Step 2 of the wizard.

Generate HTML page
This check box controls whether or not a new HTML page is added to your project for this applet. If you uncheck this, no HTML page is generated, and all the other fields on this page are disabled. If you check this box, the other fields on this page control the TITLE tag and the attributes of the APPLET tag that will be generated in the HTML page.
Title
Enter the title of your HTML page. This text will be placed between the TITLE tags in the header of the HTML page.
Name
Enter the name of the applet, as displayed in browser messages about the applet. Note that this is not the CODE attribute of the APPLET tag. The CODE tag is automatically generated from the applet class name entered on Step 1 of this wizard.
Codebase
When the applet .class file is used with this HTML page, if it will not be placed in the same directory on the web server as the HTML page (or in the appropriate directory for the applet's package), enter the relative path or absolute URL to the applet .class file location. You can think of this as a single node class path for the deployed applet .class file.
Width
Enter the number of pixels you want the HTML page to provide for the width of the applet. This value will be assigned both to the WIDTH attribute in the APPLET tag on the HTML page, and to the width property of the applet's XYLayout in the Java source.
Height
Enter the number of pixels you want the HTML page to provide for the height of the applet. This value will be assigned both to the HEIGHT attribute in the APPLET tag on the HTML page, and to the height property of the applet's XYLayout in the Java source.
HSpace
HSpace controls the amount of space to the left and right of the applet. Enter the number of pixels you want for this value. For example, if you enter a value of 20 pixels, a space 20 pixels wide will be inserted on each side of the applet, between it any surrounding text. This value will be assigned to the HSPACE attribute of the APPLET tag on the HTML page.
VSpace
VSpace controls the amount of space above and below the applet. Enter the number of pixels you want for this value. For example, if you enter a value of 20 pixels, a space 20 pixels wide will be inserted both above and below the applet, between it any surrounding text. This value will be assigned to the VSPACE attribute of the APPLET tag on the HTML page.
Align
This value controls how the applet will be aligned on the HTML page. There are three attributes on the drop-down list: This value is assigned to the ALIGN attribute in the APPLET tag of the HTML page. You can use other ALIGN values, such as LEFT or ABSBOTTOM by modifying the APPLET tag in the HTML page after it is generated by this wizard.