180 Java 里的 URL访问-- URL, showDocument
首先,你可以用多种方法设置 URL,例如:
String npacurl = "http://www.npac.syr.edu/index.html";
try {theinputurl=newURL(npacurl);} // URL class is in java.net
catch ( MalformedURLException e) {
System.out.println("Bad URL: " + npacurl); }
这里,你要测试URL 是否合法!
现在,显示此页面已是最简单的事情了,如下:
getAppletContext().showDocument(theinputurl, Frame targetdisplayframe);
Copyright: NPACT