Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q4023 How do you open a URL from an applet?

irt.org | Knowledge Base | Java | Q4023 [ previous next ]

Q4023 How do you open a URL from an applet?

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.