The Applet wizard creates an applet consisting of two files and adds them to the existing project:
<applet>
tag referencing your applet class. This file is generated if the Generate HTML Page option is set on Step 3 of the wizard. Applet
or JApplet
. This is the main UI container to which you'll add UI components using the UI designer.See also
To open the Applet wizard,
The wizard displays default names for the package and applet class file.
Displays the package name derived from the project file. To assign a different package name to the applet file, click in the Package field and type a new name or select an existing package name from the drop-down list.
For more information on packages, see the "Packages" topic in the "Creating and managing projects" of Introducting JBuilder.
Displays the default name assigned to the applet class. To rename it, click in the Class field and type a new name.
Displays a drop-down list box to select the class from which you want to inherit: Applet
(default) or JApplet
.
Caution: Since most web browsers do not yet support Swing, choose Applet
when developing web applets. Selecting JApplet
as the base class requires the Java Plug-in and the HTML Converter from Sun to run the applet in a browser. See "Working with applets" for more information.
Uses 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: * Description: * Copyright: Copyright (c) 2001 * Company: * @author * @version 1.0 */
Creates a main()
method in the applet file so it can be run alone for testing without being called from an HTML page.
Creates the standard applet methods: start()
, stop()
, destroy()
, getAppletInfo()
, and getParameterInfo()
.
The grid on this page is used to enter the information that defines the parameters for your applet. This information generates param
tags within the <applet>
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.
A name for the parameter. This is used as the name
attribute in the <param>
tag in the HTML file and as the name
parameter of the corresponding getParameter()
call in the Java source.
The type of variable that is inserted in the Java source code of your applet for holding the value of the parameter coming in from the HTML page.
A brief description of the parameter. This is 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.
The name of the variable that is inserted into the Java source code of your applet for holding the value of the parameter coming in from the HTML page.
The default value for the parameter. This is the value that the Java source code in this applet uses if a future HTML file that uses this applet doesn't have a <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.
This page of the wizard controls the generation of the applet's HTML page that is inserted in 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.
Determines if a new HTML page containing the <applet>
tag is added to your project for this applet. If this check box is off, no HTML page is generated and all the other fields on this page are disabled. If this check box is on, the other fields on this page control the <title>
tag and the attributes of the <applet>
that are generated in the HTML page.
Important: JBuilder saves the applet HTML file to the project's output directory with the classes. This directory is named classes
by default. The project's output path is set in the Output Path field on the Paths page of the Project Properties dialog box. This makes testing the applet with an external browser easier as the class files and the HTML file are in the correct location.
The title of your HTML page which displays in the title bar of the web browser. This text is placed between the <title>
tags in the header of the HTML page.
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
attribute is automatically generated from the applet class name entered on Step 1 of this wizard.
The relative path or absolute URL to the applet .class
file location. Use this field if the applet .class
file is located in a different directory than the HTML file on the web server. You can think of this as a single node class path for the deployed applet .class
file. A value of "." means that the .class
file and the HTML file are in the same directory.
The number of pixels you want the HTML page to provide for the width of the applet. This value is assigned to the width
attribute in the <applet>
on the HTML page.
The number of pixels you want the HTML page to provide for the height of the applet. This value is assigned to the height
attribute in the <applet>
on the HTML page.
The horizontal 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 is inserted on each side of the applet, between it and any surrounding text. This value is assigned to the hspace
attribute of the <applet>
tag on the HTML page.
The vertical 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 high is inserted both above and below the applet, between it and any surrounding text. This value is assigned to the vspace
attribute of the <applet>
on the HTML page.
Controls how the applet is aligned on the HTML page. There are five attributes on the drop-down list:
top
aligns the top of the applet with the top of the text.middle
aligns the middle of the applet with the middle of the text.bottom
aligns the bottom of the applet with the bottom of the text.left
aligns the applet on the left margin of the HTML page but not inline with the text.right
aligns the applet on the right margin of the HTML page but not inline with the text.This value is assigned to the align
attribute in the <applet>
tag of the HTML page. You can use these additional align
values by modifying the <applet>
tag in the HTML page after it is generated by this wizard: texttop
, absmiddle
, baseline
, and absbottom
.