# CFAPPLET

Used in a CFFORM, CFAPPLET allows you to reference custom Java applets that have been previously registered using the ColdFusion Administrator.

To register a Java applet, open the ColdFusion Administrator and click the Applets button.

### Syntax

    <CFAPPLET APPLETSOURCE="applet_name"
        NAME="form_variable_name"
        HEIGHT="pixels"
        WIDTH="pixels"
        VSPACE="pixels"
        HSPACE="pixels"
        ALIGN="alignment"
        NOTSUPPORTED="text"
        param_1="value"
        param_2="value"
        param_n="value">

#### APPLETSOURCE

Required. The name of the registered applet.

#### NAME

Required. The form variable name for the applet.

#### HEIGHT

Optional. The height in pixels.

#### WIDTH

Optional. The width in pixels.

#### VSPACE

Optional. Space above and below applet in pixels.

#### HSPACE

Optional. Space on each side of the applet in pixels.

#### ALIGN

Optional. Alignment. Valid entries are:

- Left
- Right
- Bottom
- Top
- TextTop
- Middle
- AbsMiddle
- Baseline
- AbsBottom

#### NOTSUPPORTED

Optional. The text you want to display if the page containing a Java applet-based CFFORM control is opened by a browser that does not support Java or has Java support disabled. For example:

    NOTSUPPORTED="<B>Browser must support Java to view
    ColdFusion Java Applets</B>"

By default, if no message is specified, the following message appears:

    <B>Browser must support Java to <BR>
    view ColdFusion Java Applets!</B>

#### paramn

Optional. The valid name of a registered parameter for the applet. Specify a parameter only if you want to override parameter values already defined for the applet using the ColdFusion Administrator.

### Usage

Since Java applets must be pre-registered, the CFAPPLET tag can be very simple, taking the default parameter values as they were registered in the ColdFusion Administrator. You can also override parameters by invoking them directly in the CFAPPLET tag.

### Example

    <!--- This example shows the use of CFAPPLET --->
    <HTML>
    <HEAD>
    <TITLE>CFAPPLET Example</TITLE>
    </HEAD>

    <BODY>
    <H3>CFAPPLET Example</H3>

    <P>Used in a CFFORM, CFAPPLET allows you to reference
    custom Java applets that have been previously registered
    using the ColdFusion Administrator.
    <P>To register a Java applet, open the ColdFusion Administrator
    and click the "Applets" link under the "extensions" section.
    <P>This example applet copies text that you type into
    a form.  Type some text, and then click "copy" to see
    the copied text.

    <CFFORM ACTION="copytext.cfm">
        <CFAPPLET appletsource="copytext" NAME="copytext">
    </CFFORM>

    </BODY>
    </HTML>