1 package npw; 2 3 import painter.SPainter; 4 import shapes.SCircle; 5 6 import javax.swing.*; 7 import java.awt.*; 8 9 public class Target { 10 11 12 // THE SOLUTION TO THE TARGET PROBLEM 13 private void paintTheImage() { 14 SPainter klee = new SPainter("Red Dot",700,700); 15 SCircle dot = new SCircle(300); 16 klee.setColor(Color.RED); 17 klee.paint(dot); 18 SCircle dot1 = new SCircle(200); 19 klee.setColor(Color.WHITE); 20 klee.paint(dot1); 21 SCircle dot2 = new SCircle(100); 22 klee.setColor(Color.RED); 23 klee.paint(dot2); 24 } 25 26 // REQUIRED INFRASTRUCTURE 27 28 public Target() { 29 paintTheImage(); 30 } 31 32 public static void main(String[] args) { 33 SwingUtilities.invokeLater(new Runnable() { 34 public void run() { 35 new Target(); 36 } 37 }); 38 } 39 40 }