1 package NPW; 2 import shapes.SSquare; 3 import java.awt.Color; 4 import javax.swing.SwingUtilities; 5 import painter.SPainter; 6 import shapes.SCircle; 7 8 9 public class Invention1 { 10 private void paintTheImage() { 11 // numbers needed 12 int int1 = 1; 13 int int2 = 1; 14 15 SPainter yeet = new SPainter("Invention1", 700, 700); 16 SSquare sq = new SSquare(int1 * 40); 17 SCircle circ = new SCircle(int2 * 20); 18 if (int1 == int2) { 19 yeet.setColor(Color.BLACK); 20 yeet.moveToCenter(); 21 yeet.paint(sq); 22 yeet.moveToCenter(); 23 yeet.mlt(150); 24 yeet.setColor(Color.orange); 25 yeet.paint(circ); 26 } 27 while (int1 <= 7) { 28 int1 = int1 + 1; 29 yeet.setColor(Color.red); 30 31 yeet.mbk(int1); 32 yeet.mfd(int1); 33 yeet.paint(sq); 34 } 35 36 37 while (int2 > -5) { 38 int2 = int2 - 1; 39 yeet.setColor(Color.blue); 40 yeet.mbk(int2); 41 yeet.mlt(int2); 42 yeet.paint(circ); 43 } 44 45 }public Invention1() { paintTheImage(); 46 } 47 48 public static void main(String[] args) { 49 SwingUtilities.invokeLater(new Runnable() { 50 public void run () { 51 new Invention1 () ; 52 } 53 }); 54 55 } 56 } 57