/*	NAME :			Christina Florio	PROJECT :		Smiley Face/Sad Face	FILE :			Smiley.java	PURPOSE :		Project #1 for CS110	Description :	A simple applet that illustrates some of the basic drawing				and event handling capabilities of Java. The applet contains				two buttons, labels, "Smile" and "Sad". Pressing the "Smile"				button produces a smiley face, pressing the "Sad" button 				produces a sad face.*/import java.awt.*;import java.applet.Applet;import java.awt.event.*;public class Smiley extends Applet implements ActionListener	{	private boolean SMILE = true;	private Font f = new Font ("Helvetica", Font.PLAIN, 9);		public void init()	{					Button smileButton = new Button("Smile");			add(smileButton);			smileButton.addActionListener(this);						Button sadButton = new Button("Sad");			add(sadButton);			sadButton.addActionListener(this);						setBackground(Color.yellow);				}		public void actionPerformed(ActionEvent e)	{				String cmd = e.getActionCommand();						if (cmd.equals("Smile"))	{				SMILE = true;				setBackground(Color.yellow);				repaint();			} else if (cmd.equals("Sad"))	{				SMILE = false;				setBackground(Color.lightGray);				repaint();			}	}		public void paint ( Graphics g)	{						g.drawOval(50, 75, 100, 100);			g.drawLine(100, 110, 100, 130);			g.drawLine(70, 100, 90, 100);			g.drawLine(110, 100, 130, 100);						if (SMILE)				g.drawArc(70, 95, 60, 60, 225, 90);			else				g.drawArc(70, 145, 60, 60, 45, 90);							g.setFont(f);			g.drawString("Applet by Christina.", 1, 199);		}	}