alganimapp.java

来自「一个数学算法的大集合」· Java 代码 · 共 42 行

JAVA
42
字号
/* AlgAnimApp.java */import java.awt.*;import java.applet.*;import java.io.*;import java.net.*;public class AlgAnimApp extends Applet {    static String fn_label = "filename";    static String button_label = "buttonname";    URL homeURL, sourceURL;    Button start_button;    public void init() {        String file_name = this.getParameter(fn_label); 				setBackground( Color.white );        homeURL = getCodeBase();        try {            sourceURL = new URL( homeURL, file_name );        } catch( IOException e ) {            System.out.println("URL error " + file_name );        }        start_button = new Button(getParameter(button_label));        add(start_button);        validate();    } // init()    public boolean action(Event e, Object arg) {        Object target = e.target;         if (target == start_button) {            start_button.disable();            new AlgAnimFrame(this, sourceURL);            return true;        }        return false;    } // action()} // class AlgAnimApp

⌨️ 快捷键说明

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