email me at borlaj@portlandschools.org
notes previous (09/07/06) submit the dump links  
 

HWJ10_Mouse Assignments:

 

In an applet called HWJ10_Mouse

 

1. Have a message dialog box (click here for dialog boxes) appear that says why did you click me? When the user clicks the screen.

 

2. Count the number of times the user clicks and display this somehow (either a dialog box or better yet, as drawString

 

3. Draw one rectangle on the screen. And if Jane clicks it, she is given one message (you won), if she clicks outside the rectangle she is made fun of.

 

4. Create an applet that will draw a line between where the user pressed the mouse button down to where its released. Also put a rectangle on the screen that when touched will clear the screen. (to clear -just draw a white rectangle 500*500).

 

EXTRA CREDIT

5. For the project above: next to the line print out the length of the line drawn. You will need to use the distance formula.