Basic HTML version of Foils prepared 18 May 97

Foil 32 Accessing URL's in Java -- URL, showDocument

From Java Tutorial - Spring 1997 Part 4: Multithreading, useful Java classes, I/O, Networking, and the future Peking Tutorial, Web Certificate -- Spring-Summer 1997. by Nancy J. McCracken,Geoffrey C. Fox


First you set the URL in various ways using something like
String npacurl = "http://www.npac.syr.edu/index.html";
try { theinputurl = new URL(npacurl); } // URL class is in java.net
catch ( MalformedURLException e) {
  • System.out.println("Bad URL: " + npacurl); }
where you are meant to test to see if URL is legal!
The simplest thing to do now is to see this page with
getAppletContext().showDocument(theinputurl, Frame targetdisplayframe);



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Thu Jan 8 1998