Code:
//********************************************************************
// Snowman.java Author: Lewis/Loftus/Cocking
//
// Demonstrates basic drawing methods and the use of color.
//********************************************************************
import java.applet.Applet;
import java.awt.*;
public class pumpkin extends Applet
{
//-----------------------------------------------------------------
// Draws a pumpkin.
//-----------------------------------------------------------------
public void paint (Graphics g)
{
final int MID = 150;
final int TOP = 50;
setBackground (Color.black);
g.setColor (Color.white);
g.drawString ("It's the great pumpkin," ,100,50);
g.drawString ("Charlie Brown.",120,70);
g.setColor (Color.green);
g.fillRect (0, 175, 300, 50); // ground
g.setColor (Color.yellow);
g.fillArc (10, -10, 80, 80, 80, 200); // moon
g.setColor (Color.orange);
g.fillOval (MID-70, TOP+90, 60, 50); // first pumpkin
g.fillOval (MID+90, TOP+90, 60, 50); // third pumpkin
g.fillOval (MID+0, TOP+90, 80, 60); // second pumpkin
g.setColor (Color.darkGray);
g.fillOval (MID-50, TOP+105, 10, 10); // 1st pumpkin's left eye
g.fillOval (MID-40, TOP+105, 10, 10); // 1st pumpkin's right eye
g.fillOval (MID+20, TOP+103, 15, 15); // 2nd pumpkin's left eye
g.fillOval (MID+45, TOP+103, 15, 15); // 2nd pumpkin's right eye
g.fillOval (MID+105, TOP+105, 10, 10); // 3rd pumpkin's left eye
g.fillOval (MID+125, TOP+105, 10, 10); // 3rd pumpkin's right eye
g.setColor (Color.black);
g.fillArc (MID-50, TOP+120, 20, 10, 190, 160); // smile
g.fillArc (MID+110, TOP+120, 20, 10, 190, 160); // 3rd pumpkin's smile
g.fillArc (MID+25, TOP+110, 30, 30, 190, 160); // 2nd pumpkin's smile
g.setColor (new Color(247,223,91));
g.fillOval (MID-130,TOP+60,50,50); //head
g.setColor (Color.black);
g.drawArc (MID-105,TOP+85,20,10,190,160); //smile
g.fillOval (MID-105, TOP+75,5,5); //left eye
g.setColor (new Color(191,131,13));
g.fillArc (MID-130, TOP+140, 50, 30, 0, 90); //shoe
g.setColor (new Color(255,222,32));
g.fillRect (MID-120, TOP+100, 30, 40); //Charlie's body
}
}
that's my code for an applet. is it possible to make the words flashing, and if so, how?