All pastes #983197 Raw Edit

Espejo

public java v1 · immutable
·published 2008-04-13 03:34 UTC
rendered paste body
import java.applet.Applet;import java.awt.*;public class thinLens extends Applet{    private void begin()    {        m = new LensWindow(windowTitle, false);        go();    }    public thinLens()    {        buttonText = "start";        windowTitle = "Lentes Delgadas y Espejos";        windowWidth = 600;        windowHeight = 350;        windowCount = 0;    }    private void go()    {        m.resize(windowWidth, windowHeight);        m.show();        m.start();    }    public static void main(String args[])    {        (new thinLens()).begin();    }    public boolean action(Event e, Object arg)    {        if((e.target instanceof Button) && ((String)arg).equals(buttonText))            m = new LensWindow(String.valueOf(++windowCount) + ":" + windowTitle, true);        go();        return true;    }    public void init()    {        String str;        if((str = getParameter("buttonText")) != null)            buttonText = str;        if((str = getParameter("windowTitle")) != null)            windowTitle = str;        if((str = getParameter("windowWidth")) != null)            windowWidth = Integer.parseInt(str);        if((str = getParameter("windowHeight")) != null)            windowHeight = Integer.parseInt(str);        if((str = getParameter("autoStart")) != null)        {            m = new LensWindow(windowTitle, true);            go();        }        add(new Button("Start"));    }    String buttonText;    String windowTitle;    int windowWidth;    int windowHeight;    LensWindow m;    int windowCount;}