trying to pass values from an html page to an applet ...

L

lbrtchx

~
you can pass values from a java applet to an HTML page going:
~
document.applets[0].<applet's_public_method>
~
as explained here:
~
http://www.devx.com/tips/Tip/29394
~
but how can you pass it from the HTML page to the java applet?
~
Say you have a combo box on an HTML page that updates the type and
size of some font on a label in an applet, how can you do that?
~
Thanks
lbrtchx
 
J

John B. Matthews

~
you can pass values from a java applet to an HTML page going:
~
document.applets[0].<applet's_public_method>
~
as explained here:
~
http://www.devx.com/tips/Tip/29394
~
but how can you pass it from the HTML page to the java applet?
~
Say you have a combo box on an HTML page that updates the type and
size of some font on a label in an applet, how can you do that?

If applet parameters aren't sufficient:

<http://java.sun.com/docs/books/tutorial/deployment/applet/param.html>,

consider putting the combo box in the applet.
 
A

Andrew Thompson

~
I used the combo box example as a way to explain the kinds of things
that I needed

Is there anything in your examples that cannot be
done in pure Java? If not, I would recommend you
follow JBM's advice and write the combo (or whatever)
into the applet(s).

Do you control the code?

If you can make the applets pure Java, I would then
go on to recommend freeing them from the browser, by
launching them using webstart.

If you do not control the applet code, or there are
vital web page/applet interactions, it becomes more
complicated. Have a look over Real's HowTo*, where
there are plenty of examples of Java/JS interaction
to demonstrate what is possible, as well as some of
the limitations (e.g. AFAIU, JS can access all *public*
members of an applet, but if no reference is held to a
particular GUI component, or it is not visible, there
is no way to access or change it).

* http://www.rgagnon.com/howto.html
 

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

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top