ok here are exerpts from one version...it may have unnecessary code from my attempt to make it work in netscape
public void start() {
try {
URL url = new URL(location);
URLConnection con = url.openConnection();
DataInputStream in = new DataInputStream(con.getInputStream());
total = in.readInt();
in.close();
}
catch(Exception e) {
System.out.println("Cannot open connection to server");
}
}
public void quit() {
try {
URL url = new URL(location);
URLConnection con = url.openConnection();
con.setDoOutput(true);
con.setUseCaches(false);
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
//con.setRequestProperty("Content-Type", "application/octet-stream");
DataOutputStream out = new DataOutputStream(con.getOutputStream());
out.writeInt(total);
out.flush();
out.close();
AppletContext ac = getAppletContext();
URL next = new URL("http://javaguy.yi.org/examples/MoreQuiz.html");
ac.showDocument(next, "_self");
}
catch(Exception e) {
System.out.println("Cannot open connection to server");
}
}