Advertisement
Guest User

instruct

a guest
Oct 17th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1.  
  2. What you get:
  3. Class Program2 does the following:
  4. It declares a set of 6 constants, 2 integer variables, and a Random object.
  5. The main() method sets up the program’s JFrame and calls the loop() method.
  6. The loop() method picks a random point (row, column) inside the boundaries of the square, pauses the program for 2 seconds, and asks the JFrame to re-paint itself. This causes the program to constantly re-draw a new tunnel every 2 seconds.
  7. The paint() method must draw the tunnel using the current row and column.
  8. Class Wait is used to pause the program for 2 seconds using Wait.manySec(2);
  9.  
  10. Your Job:
  11.  
  12. In the paint method in class Program2 add code so that your program draws the square and lines as shown.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement