Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q4023 How do you open a URL from an applet?

You are here: irt.org | FAQ | Java | Q4023 [ previous next ]

By using the method showDocument(URL) see the example below:

URL url = getCodeBase(); // get url of the applet
try {
  getAppletContext().showDocument (new URL(url+"blah.html"));
} catch(MalformedURLException e) {
  showStatus("URL not found");
}

this code will load the file blah.html from the same directory where the applet is situated on the server and if the file is not found display error message on the status bar.

Feedback on 'Q4023 How do you open a URL from an applet?'

©2018 Martin Webb