com.ibm.as400.util.html
Class HTMLApplet
- java.lang.Object
-
- com.ibm.as400.util.html.HTMLTagAttributes
-
- com.ibm.as400.util.html.HTMLApplet
-
- All Implemented Interfaces:
- HTMLTagElement, java.io.Serializable
public class HTMLApplet extends HTMLTagAttributes implements java.io.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:
- ElementEvent - The events fired are:
- elementAdded
- elementRemoved
- PropertyChangeEvent
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description HTMLApplet()
Constructs a default HTMLApplet object.HTMLApplet(java.lang.String code)
Constructs an HTMLApplet object with the specified applet code.HTMLApplet(java.lang.String code, int width, int height)
Constructs an HTMLApplet object with the specified Applet code, width, and height.HTMLApplet(java.lang.String code, java.lang.String codebase, int width, int height)
Constructs an HTMLApplet object with the specified Applet code, codebase, width, height.HTMLApplet(java.lang.String archive, java.lang.String code, java.lang.String codebase, int width, int height)
Constructs an HTMLApplet object with the specified Applet code, codebase, width, and height.
-
Method Summary
Methods Modifier and Type Method and Description void
addElementListener(ElementListener listener)
Adds an addElementListener.void
addParameter(HTMLParameter param)
Adds a parameter to the applet tag.HTMLParameter
addParameter(java.lang.String name, java.lang.String value)
Adds a HTMLParameter to the applet.java.lang.String
getArchive()
Returns the name of the archive(s).java.lang.String
getCode()
Returns the class name of the applet class.java.lang.String
getCodebase()
Returns the base URL of the applet.java.lang.String
getFOTag()
Returns a comment tag.int
getHeight()
Returns the height of the applet in pixels.java.lang.String
getTag()
Returns the tag for the HTML applet.java.lang.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(java.lang.String archive)
Sets the name of one or more archives containing classes and other resources that will be "preloaded".void
setCode(java.lang.String code)
Sets the class name of the applet code.void
setCodebase(java.lang.String codebase)
Sets the base URL of the applet.void
setHeight(int height)
Set the height of the applet in pixels.void
setText(java.lang.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.java.lang.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
-
-
-
-
Constructor Detail
-
HTMLApplet
public HTMLApplet()
Constructs a default HTMLApplet object.
-
HTMLApplet
public HTMLApplet(java.lang.String code)
Constructs an HTMLApplet object with the specified applet code.- Parameters:
code
- The applet name.
-
HTMLApplet
public HTMLApplet(java.lang.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(java.lang.String code, java.lang.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(java.lang.String archive, java.lang.String code, java.lang.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(java.lang.String name, java.lang.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 java.lang.String getArchive()
Returns the name of the archive(s).- Returns:
- The archive(s).
-
getCode
public java.lang.String getCode()
Returns the class name of the applet class.- Returns:
- The applet name.
-
getCodebase
public java.lang.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 java.lang.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 java.lang.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 interfaceHTMLTagElement
- Returns:
- The comment tag.
-
getTag
public java.lang.String getTag()
Returns the tag for the HTML applet.- Specified by:
getTag
in interfaceHTMLTagElement
- 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(java.lang.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(java.lang.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(java.lang.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(java.lang.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 java.lang.String toString()
Returns a String representation for the HTMLApplet tag.- Overrides:
toString
in classjava.lang.Object
- Returns:
- The tag.
-
-