Example Check Box

The main goal of this first example is to show how to use CheckBox.class. For a listing of the attributes associated with the Check Box Widget, click on CheckBox.class. This example uses a check box (FastCheck) and a line plot (Plot). FastCheck sets the update rate for Plot to either 50msec or 250msec depending on whether FastCheck is checked or unchecked. Plot is receiving a random byte as its input. Here is a snapshot of what the html page looks like in a "WYSIWYG" tool:


Figure 1.

To create a check box named FastCheck which sets the update rate for Plot, the following is used:

<APPLET CODE="CheckBox.class" WIDTH="90" HEIGHT="14" NAME="FastCheck">
<PARAM NAME="href" VALUE="Amulet:document.Plot.setUpdateRate()">
<PARAM NAME="fontSize" VALUE="2">
<PARAM NAME="fontStyle" VALUE="plain">
<PARAM NAME="name" VALUE="Fast Update">
<PARAM NAME="initialCondition" VALUE="off">
<PARAM NAME="checkedValue" VALUE="0.05">
<PARAM NAME="unCheckedValue" VALUE="0.25">
<PARAM NAME="groupName" VALUE="default">
</APPLET>

FastCheck will set the update rate for Plot to either 50msec or 250msec depending if FastCheck is checked or unchecked by using the href function Amulet:document.Plot.setUpdateRate().

To create a line plot named Plot that uses a random byte as its input, the following is used:

<APPLET CODE="LinePlot.class" WIDTH="166" HEIGHT="92" NAME="Plot">
<PARAM NAME="href" VALUE="Amulet:math.randomByte.value()">
<PARAM NAME="yMin" VALUE="0">
<PARAM NAME="yMax" VALUE="255">
<PARAM NAME="xSamples" VALUE="16">
<PARAM NAME="lineWeight" VALUE="2">
<PARAM NAME="updateRate" VALUE=".25">
</APPLET>

Plot updates every 250msec, getting a random byte that is generated internally by using the href function Amulet:math.randomByte.value().

NOTES:



Amulet HTMLCompiler,
Copyright © 2000-2004 by
Amulet Technologies, LLC

Back to Welcome - Contact Amulet - Amulet Home