General discussion

Locked

rendering HTML from java apps/applet

By jcdesai ·
We are using JDK1.2.2, how would we develop an application or an applet that can read an HTML file and render it in a browser - a la the HTML control available in the microsoft world with VJ++.

We are still looking to render on a windows PC usingIE.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

rendering HTML from java apps/applet

by duganjc73 In reply to rendering HTML from java ...

This is from a Java TechMail that I just read. ---

Opening a new Web page from a Java applet
Want a simple way to open a Web page in Java? Use the showDocument method to instruct the browser to load a new page.

The showDocument method tells the browser to load the Web page pointed to by the URL you supply. The following sample code loads TechRepublic's Web site into the browser:
try {
// create a URL for your call to showDocument
URL url= new URL("http://www.techrepublic.com");
// tell the browser to load your web page
getAppletContext().showDocument(url);
}
catch(MalformedURLException e) {
showStatus("URL not found");
}

When creating a new URL, Java requires that any MalformedURLExceptions be caught, so we enclosed our code in a try/catch construct.

I hope this helps...

Collapse -

rendering HTML from java apps/applet

by jcdesai In reply to rendering HTML from java ...

Poster rated this answer

Collapse -

rendering HTML from java apps/applet

by jcdesai In reply to rendering HTML from java ...

This question was closed by the author

Back to Web Development Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums