This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Applets and the fly likes Using applet to write to HTML page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Using applet to write to HTML page" Watch "Using applet to write to HTML page" New topic
Author

Using applet to write to HTML page

Ali Kiyani
Greenhorn

Joined: Sep 15, 2005
Posts: 7
Hello,

How do I write to a HTML page using applet? Let's say I want to print "Hello World" through applet which will be displayed inside a <div> tag in HTML, how do I do that?

Thanks
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

You do it with Javascript.

You'll have to put suitable Javascript code in the page which allows that to happen, then you can have the applet call Javascript functions. I haven't done that myself but it's certainly possible.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41045
    
  43
Actually, Javascript is not required. The page DOM can be manipulated via the Common DOM API. The AppletsFaq links to an article about that.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using applet to write to HTML page
 
Similar Threads
Applets-----To------HTML page .....How?
AccessControlException Problem
applets reading from text file on client machine?
Why comment in applet java program
html+applet+servlet=how to do