Be sure to scroll down and read the comments BELOW the canvas.



  1. Press down your mouse button and drag around on the Applet Canvas and see what pretty and colorful patterns you can create. Release the mouse button and drag again from a different point too.

  2. In the Williams College textbook, and the website for the original Scribble application, the deleting or commenting out of the following line of code is suggested.
    public void onMouseDrag(Location point)
    {
       new Line(nextLineStarts, point, canvas);
       nextLineStarts = point;                    // What if this line is gone?
                                                  // Where will all lines start?
    }
       
    
  3. Reread the material in the "Using formal parameters and instance variables together" section of Lecture #3, and try out Demo4 Scribble again too.

  4. VIP: Why do you need an INSTANCE VARIABLE in the original Scribble program, and why do you need one in this colorful Scribble program. This is VIP for your work on Friday's assignment, if you are to successfully change Text from BOLD to PLAIN and HIDE and SHOW the circle and the line. It is VIP! INSTANCE VARIABLES ARE DIFFERENT THAN LOCAL VARIABLES!!!!!!!!!!!

  5. Look at your Quick Summary of Graphic Object and Methods BLUE sheet. Under the Constructors for Auxillary Classes you will see the following:
         new Color(redness, greenness, blueness);
    
         This allows the mixing of a new color.  Each parameter must
         be a value between 0 and 255.  
    
         Thus there are 256 different levels of redness that can be chosen
         when you are mixing a color.
    
         With 256 levels of greenness, and 256 levels of blueness,
         we have a possibility of 16 million+ different colors.
    
                                                     3
         256 ^ 3 = 256 * 256 * 256 = 16,777,216 = 256
    
         To get the color RED, you would do this:
    
         new Color(255, 0, 0);
    
         To get the color PURPLE, we would use ---- new Color(255, 0, 255);
         To get the color YELLOW,          use ---- new Color(255, 255, 0);
         To get a LIGHT GRAY color,        use ---- new Color(212, 212, 212);
                                         BLACK      new Color(0, 0, 0);
                                         WHITE      new Color(255, 255, 255);
    
  6. The Java code for this program was handed out Wednesday, Sep 11th in class. You can look at pages 262 and 263 in the Big Java book for how to get the RANDOM numbers between 0 and 255 to give the random colors, but the nextInt() method on page 263, you are NOT expected to understand until late in October or after! Random numbers allow for some especially fun and appealing programs, which is why I am introducing them here in week #3.