Computer Science 252
Problem Solving with Java
Spring 2015, The College of Saint Rose
Agenda
Modify the FallingSnow example so that each snowflake (that is, each FallingSnow object) stops falling when it reaches the bottom of the canvas, but then remains on the canvas for 5 seconds before "melting". During this 5 seconds, the snowflake should move down by 1 pixel every half second, then get removed from the canvas as before.
Please submit only the file FallingSnow.java in Submission Box under "InClass12" before you leave class.
You may also demonstrate your working program for credit, in which case you do not need to submit it.
Modify the FallingBalls example so that the object that falls is a VisibleImage displaying a small image showing some sort of ball of your choice (e.g., a baseball, basketball, beach ball, etc.) instead of a simple FilledOval. Recall that you will need to call getImage in your WindowController class and pass the Image object it returns to you as a parameter to the FallingBall constructor, where you can use it to create the VisibleImage. If you get run-time errors, check to be sure that you have no used any spaces in file or folder names anywhere along the path to your project. There is a bug in Java's API that causes getImage to fail if spaces are used in folder names.
Please submit only the file FallingBall.java in Submission Box under "InClass12-2" before you leave class.
You may also demonstrate your working program for credit, in which case you do not need to submit it.
No New Lecture Assignment
Finish up the In-Class Exercises if you did not have a chance, then wrap up the lab.
Examples