/* * Program to paint a blue dot in the context of the Nonrepresentational * Painting World, NPW. */ package npw; import painter.SPainter; import shapes.SCircle; import javax.swing.*; import java.awt.*; public class Dots { // THE SOLUTION TO THE BLUE DOT PROBLEM private void paintTheImage() { SPainter klee = new SPainter("Dots",600,600); SCircle dot2 = new SCircle(50); SCircle dot3 = new SCircle(90); SCircle dot4= new SCircle(90); SCircle dot5 = new SCircle(30); SCircle dot6 = new SCircle(30); SCircle dot7 = new SCircle(65); SCircle dot8 = new SCircle(65); SCircle dot9 = new SCircle(45); SCircle dot10 = new SCircle(45); klee.mbk(100); klee.setColor(Color.BLUE); klee.paint(dot2); klee.mfd(100); klee.setColor(Color.RED); klee.mfd(150); klee.mlt(150); klee.paint(dot3); klee.setColor(Color.RED); klee.mrt(300); klee.paint(dot4); klee.setColor(Color.GRAY); klee.mbk(200); klee.mfd(50); klee.paint(dot5); klee.setColor(Color.GRAY); klee.mlt(300); klee.paint(dot6); klee.setColor(Color.BLACK); klee.mbk(100); klee.paint(dot7); klee.setColor(Color.BLACK); klee.mrt(300); klee.paint(dot8); klee.setColor(Color.GRAY); klee.mbk(125); klee.paint(dot9); klee.setColor(Color.GRAY); klee.mlt(300); klee.paint(dot10); } // REQUIRED INFRASTRUCTURE public Dots() { paintTheImage(); } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { new Dots(); } }); } }