wblauncher.java

来自「it is whiteboard sourse code」· Java 代码 · 共 42 行

JAVA
42
字号
package org.merlin.step.nov;import java.awt.*;import java.awt.event.*;import java.applet.*;public class WBLauncher extends Applet {  Image image;  Frame wb;    public void init () {    image = getImage (getCodeBase (), "wb.jpeg");    enableEvents (AWTEvent.MOUSE_EVENT_MASK);  }  public void destroy () {    if (wb != null)      wb.dispose ();  }  public void paint (Graphics g) {    g.drawImage (image, (getSize ().width - image.getWidth (this)) / 2,                 (getSize ().height - image.getHeight (this)) / 2, this);  }  protected void processMouseEvent (MouseEvent e) {    super.processMouseEvent (e);    if (e.getID () == MouseEvent.MOUSE_PRESSED) {      try {        if (wb == null) {          Class theClass = Class.forName ("org.merlin.step.nov.WB");          wb = (Frame) theClass.newInstance ();          wb.dispatchEvent (new ActionEvent (this, AWTEvent.RESERVED_ID_MAX + 1, ""));        }        wb.setVisible (true);      } catch (Exception ex) {        ex.printStackTrace ();      }    }  }}

⌨️ 快捷键说明

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