Read Form fields from Applet. Do I need Javascript?

R

Roberto Gallo

Hi,

I have an applet running inside an html document and I need to read and
to set some of html form's textfield and textarea input from my applet.

How can I do that? Do I need a javascript?

Thank you,

Roberto Gallo
 
M

Martin Honnen

Roberto said:
I have an applet running inside an html document and I need to read and
to set some of html form's textfield and textarea input from my applet.

How can I do that? Do I need a javascript?

You need LiveConnect Java --> JavaScript so start with
<applet mayscript ...></applet>
in the HTML markup so that the browser allows the applet to call into
script.
Then in the Java applet you need to import
import netscape.javascript.*;
then you can do
JSObject window = JSObject.getWindow(this);
in the applet to get the JavaScript window object wrapped as a JSObject
in Java. Then you can access members, call methods or evaluate script
code, see
<http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/java_js.html>
for details.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top