Computer Science 252
Problem Solving with Java

Fall 2014, The College of Saint Rose

Lab 6: Bouncy GUI Ball
Due: 11:59 PM, Wednesday, October 22, 2014

This week, you will gain more experience with Java Swing GUI components and event handlers while working with an active object.

You may work alone or with a partner on this lab. Only one submission per group is needed.

Getting Set Up

Download the a starter project with partial implementations of some of the programs from here.

Working solutions to all programs can be downloaded here.

The Bouncy GUI Ball

Your task is to complete the implementation of the bouncy GUI ball game. The provided starter code creates a simple bouncing ball active object.

You will need to make the following enhancements:

Clearly, you will need to add some GUI swing components and appropriate listeners. You will also need to plan how to get the information from the event handlers to the ball.


A working solution for the program will appear below. Click inside the applet to interact with it.

Bonus Opportunity

You can earn up to 5 points of bonus for enhancements to the programming assignment. Check with your instructor for point values for any enhancements you wish to attempt.


Before 11:59 PM, Wednesday, October 22, 2014, submit your lab for grading. There are two things you need to do to complete the submission: (i) Upload a copy of your lab (a .7z or .zip file containing your project directory) using Submission Box under assignment "Lab6". (ii) Demonstrate the execution of your programs for your instructor. (2 business day grace period for demos).


This assignment is worth 55 points, which are distributed as follows:

> FeatureValueScore
Slider created and placed at right of window 3
Slider listener set up properly 3
Slider resizes ball correctly 3
Color picker combo box placed in bottom panel and populated 3
Combo box listener set up properly 3
Ball changes color when combo box selection changed 3
Stop button placed in bottom panel 2
Stop button listener set up properly 3
Stop button stops the ball immediately 3
Key listeners set up properly 4
Arrow keys accelerate ball correctly 5
Style, Design, and Efficiency
Appropriate comments 5
Good variable names 3
Appropriate variable declarations 3
Good use of constants 3
Appropriate formatting 1
Efficiency 2
Good overall design and methods 3