ADM CApplet Widget

This class extends awt.Applet and contains code to connect to a cdev IOservice such as the cdevGateway. By default it connects to the port specified in the HTML PORT PARAM tag or to default port 9199 of the web server if the PORT PARAM tag is not defined. A port number also can be passed to CApplet via an init (int port) method (called, for example, by a derived class).

CApplet implement its own start() and stop() methods to resume or suspend the IOservice when the applet becomes visible or temporarily invisible.

If you subclass the CApplet, you only have to add widgets in the init() method, and they will appear (live) on the web page. For example:


import java.awt.*;
import adm.*;

public class MyApplet extends CApplet  {
    public void init () {
        super.init(9200);  // if you want use port 9200

        CBits bits = new CBits("R121", "int");
        bits.setSize(150, 50);
        bits.setLabelStyle(CConstants.LABEL_AXIS);
        add(bits);

	CBar bar = new CBar("R121", "pp");
	bar.setSize(60, 120);
	bar.setColorMode(CConstants.CLRMOD_ALARM);
	bar.setLabelStyle(CConstants.LABEL_ALL);
	add(bar);
   }	
}