DelphiFAQ Home Search:
General :: Programming :: Java :: Applets


Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

How do you open a URL from an applet?

Question:

How do you open a URL from an applet?

Answer:

By using the method showDocument(URL) see the example below. This code will load the file test.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.

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

Generated 20:02:23 on Oct 17, 2017