1 package npw; 2 import java.awt.Color; 3 import javax.swing.SwingUtilities; 4 import painter.SPainter; 5 import shapes.SCircle; 6 public class Dots { 7 8 9 private void paintTheImage() 10 { 11 SPainter canvas= new SPainter("Dots",1000,1000); 12 SCircle dot1= new SCircle(50); 13 SCircle dot2= new SCircle(75); 14 SCircle dot3= new SCircle(100); 15 SCircle dot4= new SCircle(125); 16 SCircle dot5= new SCircle(50); 17 SCircle dot6= new SCircle(75); 18 SCircle dot7= new SCircle(100); 19 SCircle dot8= new SCircle(125); 20 SCircle dot9= new SCircle(50); 21 22 23 canvas.location.setLocation(300,600); 24 canvas.setColor(Color.RED); 25 canvas.paint(dot1); 26 canvas.location.setLocation(200,800); 27 canvas.setColor(Color.BLUE); 28 canvas.paint(dot2); 29 canvas.location.setLocation(300,400); 30 canvas.setColor(Color.GREEN); 31 canvas.paint(dot3); 32 canvas.location.setLocation(200,150); 33 canvas.setColor(Color.ORANGE); 34 canvas.paint(dot4); 35 canvas.location.setLocation(700,600); 36 canvas.setColor(Color.RED); 37 canvas.paint(dot5); 38 canvas.location.setLocation(800,800); 39 canvas.setColor(Color.BLUE); 40 canvas.paint(dot6); 41 canvas.location.setLocation(700,400); 42 canvas.setColor(Color.GREEN); 43 canvas.paint(dot7); 44 canvas.location.setLocation(800,150); 45 canvas.setColor(Color.ORANGE); 46 canvas.paint(dot8); 47 canvas.location.setLocation(500,500); 48 canvas.setColor(Color.RED); 49 canvas.paint(dot9); 50 } 51 public Dots() 52 { 53 paintTheImage(); 54 } 55 public static void main(String[] args) 56 { 57 SwingUtilities.invokeLater(new Runnable() { 58 public void run() { 59 new Dots(); 60 } 61 }); 62 } 63 } 64