import java.awt.Color; import uwcse.graphics.GWindow; import uwcse.graphics.Oval; public class SomeGraphics { // Use classes from the uw library private GWindow window; private Oval circle1, circle2; /** * Creates a graphics window with a circle */ public SomeGraphics() { window = new GWindow(); circle1 = new Oval(); window.add(circle1); circle2 = new Oval(300, 100, 90, 90, Color.BLUE, true); window.add(circle2); } /** * Swaps the colors of the two circles */ public void swapColors() { Color color2 = circle2.getColor(); circle2.setColor(circle1.getColor()); circle1.setColor(color2); } /** * Entry point of the application */ public static void main(String[] args) { SomeGraphics s = new SomeGraphics(); // pause the execution for 2s try { Thread.sleep(2000); } catch (InterruptedException e) { } s.swapColors(); } }