/////////////////////////////////////////////// // Java 2 APPLET zFotoRotulo.java // Wilucha 07/08/02 ////////////////////////////////////////////// import java.awt.Graphics; import java.awt.Color; import java.awt.Font; import java.awt.Image; public class zFotoRotulo extends java.applet.Applet implements Runnable { Font TipoLetra = new Font("TimesRoman", Font.BOLD, 50); Color ColorActual[] = new Color[50]; Thread Activo; Image wilo; public void init() { wilo = getImage(getCodeBase(), "aWilucha.jpg"); } public void start() { if (Activo == null) { Activo = new Thread(this); Activo.start(); } } public void stop() { Activo = null; } public void run() { float c = 0; for (int i = 0; i < ColorActual.length; i++) { ColorActual[i] = Color.getHSBColor(c, (float)1.0,(float)1.0); c += .02; } int i = 0; Thread thisThread = Thread.currentThread(); while (Activo == thisThread) { setForeground(ColorActual[i]); repaint(); i++; try { Thread.sleep(200); } catch (InterruptedException e) { } if (i == ColorActual.length ) i = 0; } } public void paint(Graphics screen) { int AnchoFoto = wilo.getWidth(this); int AltoFoto = wilo.getHeight(this); int AbsisaFoto = 10; int OrdenadaFoto = 10; screen.drawImage(wilo, AbsisaFoto, OrdenadaFoto, AnchoFoto / 4, AltoFoto / 4, this); screen.setFont(TipoLetra); int Xrotulo=5; int Yrotulo=90; screen.drawString("Paradigmas", Xrotulo, Yrotulo); } }