okay. Ive got it going. and I am able to access javascript in my applet. I have an issue...naturally.
Lets say that the url 'myHost' does not go to a website, but merely sets a flag.
Here is mycode:
html:
Code:
<APPLET CODE=test.class WIDTH=600 HEIGHT=750>
</APPLET>
<SCRIPT>
function backme() {
history.back();
}
</SCRIPT>
Applet:
Code:
if(e.getActionCommand().equals(" SEND ")){
try{
// set flag
url = new URL(myHost);
con = url.openConnection();
con.setAllowUserInteraction(true);
n = con.getInputStream();
d = new DataInputStream(n);
}catch(Exception x){
inputOutputField.setText("err: bad data");
}
// go back to prevouis page.
JSObject win = JSObject.getWindow(this);
String args[] = {""};
win.call("backme", args);
}
Now when the send button is hit it will only go back to the previous page.
Maybe a sleep() call will help? Im not sure why it does not try to send data to myHost.
Any help would be appreciated.
Im close, I can taste it.
Bookmarks