import java.awt.Graphics; import java.awt.Font; import java.awt.Color; import java.applet.Applet; public class areli extends Applet { /** * Initializes the applet. You never need to call this directly; it is * called automatically by the system once the applet is created. */ int estado = 1; public void paint (Graphics g) {for (int i=1; i<5;i++) {estado =i; g.setFont(new Font("Courier", Font.BOLD, 35)); g.drawString ("HOLA! QUE ONDA!!!! :)", 0, 50); g.setColor (Color.white); g.fillOval (105, 170, 90, 120); g.setColor (Color.blue); g.fillRect (90,150,120,30); g.setColor (Color.red); int[] puntosx={103, 191, 150};int[]puntosy={149, 149, 90}; {if (estado==1) {g.setColor (Color.blue);} else {if (estado==2) {g.setColor (Color.green);} else {if (estado==3) {g.setColor (Color.red);} else {if (estado==4) {g.setColor (Color.black);} }}}} g.fillPolygon (puntosx,puntosy,3); {if (estado==1) {g.setColor (Color.green);} else {if (estado==2) {g.setColor (Color.blue);} else {if (estado==3) {g.setColor (Color.black);} else {if (estado==4) {g.setColor (Color.white);} }}}} g.fillOval (130, 208, 10,10); g.fillOval (162, 208, 10,10); g.setFont(new Font("TimesRoman", Font.BOLD, 25)); g.drawString ("o", 144, 230); g.setFont(new Font("Helvetica", Font.ITALIC, 25)); g.drawString ("O", 143, 270); for (int j=0; j<100000; j++){} } } public void init() { } /** * Called to start the applet. You never need to call this directly; it * is called when the applet's document is visited. */ public void start() { } /** * Called to stop the applet. This is called when the applet's document is * no longer on the screen. It is guarenteed to be called before destroy() * is called. You never need to call this method directly */ public void stop() { } /** * Cleans up whatever resources are being held. If the applet is active * it is stopped. */ public void destroy() { } }