|
About Tech Experiments System Dev't |
July082008July 8, 2008 Meeting Dummy Applet Code
import java.applet.Applet;
import java.applet.AppletContext;
import java.net.URL;
public class DetectionApplet extends Applet {
public void init() { }
public void detectDevices(String deviceCallback, String finishCallback) {
try {
AppletContext appletContext = getAppletContext();
String format = "javascript:%s('%s','%s');";
appletContext.showDocument(new URL(String.format(format, deviceCallback, "Cricket", "/dev/ttyS1")));
appletContext.showDocument(new URL(String.format(format, deviceCallback, "Super Cricket", "/dev/ttyS2")));
appletContext.showDocument(new URL(String.format(format, deviceCallback, "Sun SPOT", "/dev/ttyUSB1")));
appletContext.showDocument(new URL("javascript:" + finishCallback + "();"));
} catch (Exception e) {
e.printStackTrace();
}
}
}
Example Login to the beta page (http://isense.cs.uml.edu/beta) and then browse an experiment. Click the "join this experiment" link at the bottom of that page and click Detect Sensors. |