com.ibm.as400.util.html
Class HTMLApplet

java.lang.Object
  extended bycom.ibm.as400.util.html.HTMLTagAttributes
      extended bycom.ibm.as400.util.html.HTMLApplet
All Implemented Interfaces:
HTMLTagElement, Serializable

public class HTMLApplet
extends HTMLTagAttributes
implements Serializable

The HTMLApplet class represents a java application embeded within an HTML page.

This example creates a HTMLApplet tag:

  // Create an HTMLApplet.
  HTMLApplet applet = new HTMLApplet("myApplet", "http://myCompany.com/dir/", 100, 100);
  

// Create a parameter, then add it to the applet. HTMLParameter param = new HTMLParameter("parm1", "value1"); applet.addParameter(param);

// Create and add second parameter HTMLParameter param2 = applet.addParameter("parm2", "value2"); System.out.println(applet);

Here is the output of the HTMLApplet tag:

  <applet name="myApplet" codebase="http://server:port/dir" width="100" height="100";>
  <param name="parm1" value="value1">
  <param name="parm2" value="value2">
  If you see this text, the browser does not support the APPLET tag or the applet has failed to load.
  </applet>
  

HTMLApplet objects generate the following events:

See Also:
Serialized Form

Constructor Summary
HTMLApplet()
          Constructs a default HTMLApplet object.
HTMLApplet(String code)
          Constructs an HTMLApplet object with the specified applet code.
HTMLApplet(String code, int width, int height)
          Constructs an HTMLApplet object with the specified Applet code, width, and height.
HTMLApplet(String code, String codebase, int width, int height)
          Constructs an HTMLApplet object with the specified Applet code, codebase, width, height.
HTMLApplet(String archive, String code, String codebase, int width, int height)
          Constructs an HTMLApplet object with the specified Applet code, codebase, width, and height.
 
Method Summary
 void addElementListener(ElementListener listener)
          Adds an addElementListener.
 void addParameter(HTMLParameter param)
          Adds a parameter to the applet tag.
 HTMLParameter addParameter(String name, String value)
          Adds a HTMLParameter to the applet.
 String getArchive()
          Returns the name of the archive(s).
 String getCode()
          Returns the class name of the applet class.
 String getCodebase()
          Returns the base URL of the applet.
 String getFOTag()
          Returns a comment tag.
 int getHeight()
          Returns the height of the applet in pixels.
 String getTag()
          Returns the tag for the HTML applet.
 String getText()
          Returns the alternate text of the applet.
 int getWidth()
          Returns the width of the applet in pixels.
 void removeElementListener(ElementListener listener)
          Removes this ElementListener from the internal list.
 void removeParameter(HTMLParameter param)
          Removes a parameter from the applet tag.
 void setArchive(String archive)
          Sets the name of one or more archives containing classes and other resources that will be "preloaded".
 void setCode(String code)
          Sets the class name of the applet code.
 void setCodebase(String codebase)
          Sets the base URL of the applet.
 void setHeight(int height)
          Set the height of the applet in pixels.
 void setText(String text)
          Set the alternate text for the Applet, which will be displayed if the browser does not support the APPLET tag or the applet fails to load.
 void setWidth(int width)
          Set the width of the applet in pixels.
 String toString()
          Returns a String representation for the HTMLApplet tag.
 
Methods inherited from class com.ibm.as400.util.html.HTMLTagAttributes
addPropertyChangeListener, getAttributes, getAttributeString, removePropertyChangeListener, setAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HTMLApplet

public HTMLApplet()
Constructs a default HTMLApplet object.


HTMLApplet

public HTMLApplet(String code)
Constructs an HTMLApplet object with the specified applet code.

Parameters:
code - The applet name.

HTMLApplet

public HTMLApplet(String code,
                  int width,
                  int height)
Constructs an HTMLApplet object with the specified Applet code, width, and height.

Parameters:
code - The applet name.
width - The applet width.
height - The applet height.

HTMLApplet

public HTMLApplet(String code,
                  String codebase,
                  int width,
                  int height)
Constructs an HTMLApplet object with the specified Applet code, codebase, width, height.

Parameters:
code - The applet name.
codebase - The base URL.
width - The applet width.
height - The applet height.

HTMLApplet

public HTMLApplet(String archive,
                  String code,
                  String codebase,
                  int width,
                  int height)
Constructs an HTMLApplet object with the specified Applet code, codebase, width, and height.

Parameters:
code - The applet name.
codebase - The base URL.
width - The applet width.
height - The applet height.
Method Detail

addParameter

public void addParameter(HTMLParameter param)
Adds a parameter to the applet tag.

Parameters:
param - The parameter.

addParameter

public HTMLParameter addParameter(String name,
                                  String value)
Adds a HTMLParameter to the applet.

Parameters:
name - The parameter name.
value - The parameter value.
Returns:
An HTMLParameter object.

addElementListener

public void addElementListener(ElementListener listener)
Adds an addElementListener. The specified addElementListeners elementAdded method will be called each time a HTMLParameter is added to the group. The addElementListener object is added to a list of addElementListeners managed by this HTMLApplet. It can be removed with removeElementListener.

Parameters:
listener - The ElementListener.
See Also:
removeElementListener(com.ibm.as400.util.html.ElementListener)

getArchive

public String getArchive()
Returns the name of the archive(s).

Returns:
The archive(s).

getCode

public String getCode()
Returns the class name of the applet class.

Returns:
The applet name.

getCodebase

public String getCodebase()
Returns the base URL of the applet.

Returns:
The base URL.

getHeight

public int getHeight()
Returns the height of the applet in pixels.

Returns:
The height.

getText

public String getText()
Returns the alternate text of the applet.

Returns:
The text.

getWidth

public int getWidth()
Returns the width of the applet in pixels.

Returns:
The width.

getFOTag

public String getFOTag()
Returns a comment tag. This method should not be called. There is no XSL-FO support for this class.

Specified by:
getFOTag in interface HTMLTagElement
Returns:
The comment tag.

getTag

public String getTag()
Returns the tag for the HTML applet.

Specified by:
getTag in interface HTMLTagElement
Returns:
The tag.

removeParameter

public void removeParameter(HTMLParameter param)
Removes a parameter from the applet tag.

Parameters:
param - The parameter.

removeElementListener

public void removeElementListener(ElementListener listener)
Removes this ElementListener from the internal list. If the ElementListener is not on the list, nothing is done.

Parameters:
listener - The ElementListener.
See Also:
addElementListener(com.ibm.as400.util.html.ElementListener)

setCodebase

public void setCodebase(String codebase)
Sets the base URL of the applet. If the CODEBASE URL is relative, it is in relation to the current document URL.

Parameters:
codebase - The base URL.

setArchive

public void setArchive(String archive)
Sets the name of one or more archives containing classes and other resources that will be "preloaded". The archives are separated by a ",".

Parameters:
archive - The applet archive(s).

setCode

public void setCode(String code)
Sets the class name of the applet code.

Parameters:
code - The applet name.

setHeight

public void setHeight(int height)
Set the height of the applet in pixels.

Parameters:
height - The height.

setText

public void setText(String text)
Set the alternate text for the Applet, which will be displayed if the browser does not support the APPLET tag or the applet fails to load.

Parameters:
text - The alternate text.

setWidth

public void setWidth(int width)
Set the width of the applet in pixels.

Parameters:
width - The width.

toString

public String toString()
Returns a String representation for the HTMLApplet tag.

Returns:
The tag.