import uwcse.graphics.*; // access the graphics utilities in the uw library import java.awt.Color; // access the Color class /** *
* A FaceScene displays smiling faces in a graphics window *
* * @author Your name here */ public class FaceScene { /** * Creates a picture */ public FaceScene() { // The graphics window // The window is by default 500 wide and 400 high GWindow w = new GWindow(); // Exit when closing the window w.setExitOnClose(); // Background (e.g. white) Rectangle bg = new Rectangle(0, 0, 500, 400, Color.WHITE, true); w.add(bg); // Create the scene elements // e.g. a face in the lower left area 1.5 times the normal size new SmilingFace(75, 300, 1.5, w ); // more faces new SmilingFace(300, 80, 0.5, w); new SmilingFace(300, 300, 1.8, w); } /** * Starts the application */ public static void main(String[] args) { new FaceScene(); } }