Invention1.java
1    /* 
2     *Program to paint a blue dot in the context of the Nonrepresentational Painting World 
3     */
4    
5    package npw;
6    
7    import painter.SPainter;
8    import shapes.SCircle;
9    import shapes.SSquare;
10   
11   import javax.net.ssl.SSLServerSocket;
12   import javax.swing.*;
13   import java.awt.*;
14   import java.sql.SQLClientInfoException;
15   
16   public class Invention1
17   {
18       private void paintTheImage()
19       {
20           SPainter painter = new SPainter("Invention 1", 600, 600);
21           SCircle circle = new SCircle(1);
22           SSquare square = new SSquare(1);
23           int i = 6;
24           while(i > 0) {
25               if(i % 2 == 0) {
26                   painter.setColor(Color.black);
27                   square.resetSide(i * 100);
28                   painter.paint(square);
29               } else {
30                   painter.setColor(Color.blue);
31                   circle.resetRadius(i * 50);
32                   painter.paint(circle);
33               }
34               i--;
35           }
36       }
37       public Invention1()
38       {
39           paintTheImage();
40       }
41       public static void main(String[] args)
42       {
43           SwingUtilities.invokeLater(new Runnable(){public void run(){new Invention1();}});
44       }
45   }
46