B&B Electronics ADAM-6066 - Manual User Manual

Page 119

Advertising
background image

109

Chapter 5

/**Applet Information Acquisition*/
public String getAppletInfo() {
return "Applet Information";
}
/**Get parameter info*/ public String[][] getParameterInfo() { String[][]
pinfo =
{
{"HostIP", "String", ""},
};
return pinfo; }

/**Main method: for the purpose of laying out the screen in local PC*/
public static void main(String[] args) { Adam6060 applet = new
Adam6060(); applet.isStandalone = true;
Frame frame;
frame = new Frame() {
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e); if (e.getID() == Window-
Event.WINDOW_CLOSING) { System.exit(0);
}
} public synchronized void setTitle(String title) { super.setTitle(title);
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
}
}; frame.setTitle("Applet Frame"); frame.add(applet, BorderLay-
out.CENTER); applet.init();
applet.start();
frame.setSize(500,620);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation((d.width - frame.getSize().width) / 2, (d.height
- frame.getSize().height) / 2);
frame.setVisible(true);
}

Advertising