// This applet displays 3 peace signs, one in the top left corner,
// one in the bottom right corner, and one in the center. All
// are based on getSize(). A motto is also displayed in the
// bottom left hand side of the applet.
import java.awt.*;
import java.applet.*;
public class test1 extends Applet
{
public void init()
{
Color myColor;
myColor = new Color(0, 0, 0);
//Sets color to black
setBackground(myColor);
Color myColorA;
myColorA = new Color(155, 155, 0);
//Sets color to yellow
setForeground(myColorA);
}
public void paint(Graphics g)
{
//Sets the width and height of the applet
Dimension d = getSize();
int centerX = d.width/2;
int centerY = d.height/2;
int widthOfPicture = 200;
int heightOfPicture = 200;
int x = centerX - widthOfPicture/2;
int y = centerY - heightOfPicture/2;
//Declares myColor as a new color (yellow)
Color myColor1;
myColor1 = new Color(155, 155, 0);
//Sets color to yellow
g.setColor(myColor1.brighter());
//Draws a peace sign in upper left corner
Dimension e = getSize();
int ulX = e.width +50;
int ulY = e.height +50;
int x1 = centerX;
int y1 = centerY;
//int widthOfPicture1 = 200;
//int heightOfPicture1 = 200;
g.drawArc(x1,y1,50,50,-360,360);
//Draws a peace sign in the center
Dimension f = getSize();
int centerX2 = f.width/45;
int centerY2 = f.height/150;
g.drawArc(centerX2, centerY2,50,50,-360,360);
//g.drawLine(100,150,117,142);
//Draws a peace sign in the lower right corner
Dimension h = getSize();
int centerX3 = h.width-50;
int centerY3 = h.height-50;
g.drawArc(centerX3, centerY3,50,50,-360,360);
//g.drawLine(100,150,117,142);
//Sets Lucida as the new font in 18pt bold
g.setFont(new Font("Lucida", Font.BOLD, 22));
//Declares myColor1 as a new color (white)
Color myColor2;
myColor2 = new Color(255, 255, 255);
//Sets color to white
g.setColor(myColor2.brighter());
//Displays a text string message
g.drawString("Make Love, Not War!", 10, 580);
}
}