1 /* 2 *Drawing target 3 */ 4 5 6 package npw; 7 8 import java.awt.Color; 9 import javax.swing.SwingUtilities; 10 import painter.SPainter; 11 import shapes.SCircle; 12 13 public class Target{ 14 //THE SOLUTION TO THE BLUE DOT PROBLEM 15 16 private void paintTheImage () { 17 SPainter Mari = new SPainter("Target", 600, 600); 18 SCircle dot = new SCircle(200); 19 Mari.setColor(Color.red); 20 Mari.paint(dot); 21 //Make white circle 22 dot.shrink(35); 23 Mari.setColor(Color.white); 24 Mari.paint(dot); 25 //make smaller red dot 26 dot.s2(); 27 Mari.setColor(Color.red); 28 Mari.paint(dot); 29 30 } 31 32 33 // REQUIRED INFRASTRUCTURE 34 public Target(){ 35 paintTheImage(); 36 } 37 public static void main (String[] args){ 38 SwingUtilities.invokeLater(new Runnable(){ 39 public void run(){ 40 new Target(); 41 } 42 }); 43 } 44 } 45