## org.mortbay.html
Class Applet

    java.lang.Object
      org.mortbay.html.Element
          org.mortbay.html.Composite
              org.mortbay.html.Block
                  org.mortbay.html.Applet

    public class Applet

extends Block

An Applet Block.

Lets you set the class name from the program, and optionally, the size and the codebase.

This class uses any attributes set in Element.

#### Usage

     org.mortbay.Page page = new org.mortbay.html.Page();
     page.add(new org.mortbay.Applet("org.mortbay.Foo.App"));

Version:
  $Id: Applet.java,v 1.7 2004/07/19 13:12:58 hlavac Exp $
Author:
  Matthew Watson
See Also:
  `Block`

Field Summary
`String` `codeBase`

Fields inherited from class org.mortbay.html.Block
`Bold, Center, Div, Italic, Left, Listing, Plain, Pre, Quote, Right, Span, Xmp`

Fields inherited from class org.mortbay.html.Composite
`elements, nest`

Fields inherited from class org.mortbay.html.Element
`ALIGN, attributeMap, BGCOLOR, BOTTOM, CENTER, CLASS, COLOR, HEIGHT, ID, LEFT, MIDDLE, noAttributes, RIGHT, SIZE, STYLE, TOP, VALIGN, WIDTH`

Constructor Summary
`Applet(String className)` Create an Applet Element.

Method Summary
`Applet` `codeBase(String cb)` Set the codebase
`Applet` `setAlternate(Element alt)` Deprecated. use add
`Applet` `setAlternate(String alt)` Deprecated. use add
`Applet` `setDebug(boolean debug)` Set whether debugging is on in the Applet.
`Applet` `setDimensions(int height, int width)` Set the dimensions of the Applet.
`Applet` `setParam(String name, String value)`
`void` `write(Writer out)` Write out the HTML

Methods inherited from class org.mortbay.html.Composite
`add, contents, nest, replace, reset, setNest, size, unnest`

Methods inherited from class org.mortbay.html.Element
`attribute, attribute, attribute, attributes, attributes, bgColor, bottom, center, color, cssClass, cssID, height, height, height, left, middle, right, setAttributesFrom, size, size, style, top, toString, width, width, width, write, write`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### codeBase

    public String codeBase

Constructor Detail

### Applet

    public Applet(String className)

  Create an Applet Element.

  Parameters:
    `className` - The name of the class to give for the applet

Method Detail

### setDimensions

    public Applet setDimensions(int height,
                                int width)

  Set the dimensions of the Applet.

### setDebug

    public Applet setDebug(boolean debug)

  Set whether debugging is on in the Applet.

  This controls whether the org.mortbay.util.Code debug messages will be printed to the java console.

  Defaults to whether debug is turned on in the generating app

### setAlternate

    public Applet setAlternate(Element alt)

  Deprecated. use add

  Set an alternate display for non-java browsers.

  Parameters:
    `alt` - The alternate element to display

### setAlternate

    public Applet setAlternate(String alt)

  Deprecated. use add

  Set an alternate display for non-java browsers.

  Parameters:
    `alt` - The alternate element to display

### codeBase

    public Applet codeBase(String cb)

  Set the codebase

### setParam

    public Applet setParam(String name,
                           String value)

### write

    public void write(Writer out)
               throws IOException

  Write out the HTML

  Overrides:
    `write` in class `Block`
  Parameters:
    `out` - Writer to write the element to.
  Throws:
    `IOException`

Copyright © 2007 Mort Bay Consulting. All Rights Reserved.