showurl.java

来自「Java 入门书的源码」· Java 代码 · 共 25 行

JAVA
25
字号
//Copyright (c) 1998, Arthur Gittleman
//This example is provided WITHOUT ANY WARRANTY either expressed or implied.

/* Running this applet in a browser will cause
 * the browser the display the url specified as
 * the value of the url parameter in the HTML file
 * used to run the applet.  The Applet Viewer cannot
 * show a document.
 */

import java.net.*;
import java.applet.Applet;

public class ShowURL extends Applet {
  public void init() {
    try {
      URL url = new URL(getParameter("url"));
      getAppletContext().showDocument(url);
    }catch(MalformedURLException e) {
        e.printStackTrace();
    } 
  }
}  
        
    

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?