• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet to HTML

 
Angela Jessi
Ranch Hand
Posts: 428
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks Carl for response.
I have an applet. Which writes data to server and can get back data from server. Now In my applet, I want to write data what I got from server to particular field of HTML(for example: cell of table in HTML).
How to write data to particular cell from Applet?
Please let me know,
Angela
 
Grant Crofton
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you can directly write HTML from an applet.
I haven't tried this, but you might be able to get data from an applet with script (eg JavaScript) in your HTML page. I know you can call applet methods from script, but I don't know if you can read the return values.
e.g. you could have
<HTML>
<Applet name="a1" ...>
<input name="box1">
<script language=JavaScript>
box1.value = a1.doMethod();
</script>
</HTML>
NOTE: I haven't done HTML for a bit, there might be syntax errors here
If you can get the return value, you could put it in a form element in your HTML (as above).
Or, you might be able to write the HTML from the script, like:
document.write( a1.getData() );
or something similar.
You might find it easier to use JSP / ASP or something similar, where the HTML is created on the server before being sent to the browser, to do what you want.
Hope that helps.
 
Nitin Shivaram
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Dont know if this reply is too late, but anyways here is what you can do.
You could use a JSObject class and populate data in the HTML from an applet. For this u have to have the class files on client side as well.
JSObject can be found under the package "netscape.javascript.*".
Nitin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic