1 package npw; 2 3 import java.awt.Color; 4 import javax.swing.SwingUtilities; 5 import painter.SPainter; 6 import shapes.SCircle; 7 8 9 10 public class Dots { 11 12 13 private void paintTheImage() { 14 15 16 SPainter BEE = new SPainter("Blue Dot",600,600); 17 18 //top row 19 SCircle dot1 = new SCircle(90); 20 BEE.setRandomColor(); 21 BEE.mlt(200); 22 BEE.mfd(200); 23 BEE.paint(dot1); 24 25 26 SCircle dot2 = new SCircle(85); 27 BEE.moveToCenter(); 28 BEE.setRandomColor(); 29 BEE.mfd(200); 30 BEE.paint(dot2); 31 32 33 SCircle dot3 = new SCircle(75); 34 BEE.setRandomColor(); 35 BEE.moveToCenter(); 36 BEE.mrt(200); 37 BEE.mfd(200); 38 BEE.paint(dot3); 39 40 //middle row 41 42 SCircle dot4 = new SCircle(65); 43 BEE.setRandomColor(); 44 BEE.moveToCenter(); 45 BEE.mlt(200); 46 47 BEE.paint(dot4); 48 49 SCircle dot5 = new SCircle(90); 50 BEE.setRandomColor(); 51 BEE.moveToCenter(); 52 53 BEE.paint(dot5); 54 55 SCircle dot6 = new SCircle(90); 56 BEE.setRandomColor(); 57 BEE.moveToCenter(); 58 BEE.mrt(200); 59 60 BEE.paint(dot6); 61 62 //bottom row 63 64 SCircle dot7 = new SCircle(90); 65 BEE.setRandomColor(); 66 BEE.moveToCenter(); 67 68 BEE.mbk(200); 69 BEE.paint(dot7); 70 71 SCircle dot8 = new SCircle(90); 72 BEE.setRandomColor(); 73 BEE.moveToCenter(); 74 BEE.mlt(200); 75 BEE.mbk(200); 76 BEE.paint(dot8); 77 78 SCircle dot9 = new SCircle(90); 79 BEE.setRandomColor(); 80 BEE.moveToCenter(); 81 BEE.mrt(200); 82 BEE.mbk(200); 83 BEE.paint(dot9); 84 85 86 87 88 89 90 91 92 93 } 94 95 96 97 98 99 100 101 102 103 104 105 // required infrastructure 106 107 public Dots() { 108 109 paintTheImage(); 110 111 112 113 114 } 115 116 117 public static void main(String[] args) { 118 SwingUtilities.invokeLater(new Runnable() { 119 public void run() { 120 new Dots(); 121 } 122 123 124 }); 125 } 126 127 128 } 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147