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 (); } } } }