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 upper left area 0.5 times the normal size new SmilingFace(100, 80, 0.5, w); // another face in the middle of the window new SmilingFace(250, 200, 1.7, w); } /** * Starts the application */ public static void main(String[] args) { new FaceScene(); } }