@@ -0,0 +1,1157 @@
+import javax.swing.JApplet;%0Aimport java.awt.*; // import Graphics, Graphics2D, and Rectangle%0Apublic class TriSpiral extends JApplet%0A%7B%0A    public void paint (Graphics g)%0A    %7B%0A        g.setColor(Color.black);%0A%0A        /**%0A         * Here is an example of how to draw a line from (300,200) to (400,300)%0A         *%0A         * You will need to replace this code with a while-loop or for-loop%0A         * which draws a spiral.  Think about drawing lines which increase in%0A         * length each time you draw a new line.%0A         */%0A%0A        int lastx = 300, lasty = 300, newx, newy;%0A%0A        for (int i=0; i%3C200; i += 9) %7B%0A            // Down + Right%0A            newx = lastx + i; newy = lasty + i;%0A            g.drawLine(lastx, lasty, newx, newy);%0A            lastx = newx; lasty = newy;%0A%0A            // Left%0A            newx = lastx - 2*(i + 3); newy = lasty;%0A            g.drawLine(lastx, lasty, newx, newy);%0A            lastx = newx; lasty = newy;%0A%0A            // Up + Right%0A            newx = lastx + i + 6; newy = lasty - (i + 6);%0A            g.drawLine(lastx, lasty, newx, newy);%0A            lastx = newx; lasty = newy;%0A        %7D%0A%0A    %7D // end of paint%0A%7D%0A

Create TriSpiral.java