Java uses an APPLET element to place an applet in an HTML document.

General Format

<APPLET
    Codebase = "path to directory containing class files"
    Code     = "name of class file"
    Width    = "width of applet in pixels"
    Height   = "height of applet in pixels">
    <PARAM Name="parameter name" Value="value of parameter">
    <PARAM Name="parameter name" Value="value of parameter">
</APPLET>

Example

<APPLET 
  Codebase  = "https://johndecember.com/present/"
  Code      = "NervousText.class"
  Width     = "300"
  Height    = "60">
  <PARAM Name="text" Value = "Hello, World!">
</APPLET>

Note that Java-enabled browsers will ignore all the non-PARAM element text inside an APPLET element. So you could include a special message in the APPLET element explaining to the user that they don't have a Java-enabled browser and therefore can't use the feature.

search Search · star Market
2023-06-19 · John December · Terms © johndecember.com