Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Threads - Help???

Status
Not open for further replies.

PADFOR

Programmer
Feb 5, 2001
25
GB
I have been trying to solve the following problem from a java book, and I have no joy. Could you someone please give me some pointers?

The Task

Your task is to write a Java application which allows us to animate several simple shapes within a defined area of the application (perhaps a Panel). Shapes should "bounce" off the boundary of this area. The application should be multithreaded, where appropriate. You may impose an upper limit on the number of shapes if you wish, but should allow at least up to 10 shapes.

Requirements

Your application should:

1. Allow the user to add simple shapes (circles and squares) into the animation area.
2. The user should be allowed to specify:
a.which shape to add,
b.the size of the shape,
c.which colour to fill the shape with,
d.the initial trajectory (dx and dy) values.
3. Shapes should not collide with each other but should pass "through" or "over" each other.
4. Allow the user to stop/start one of the shapes moving by clicking it. The motion of all the other shapes should be unaffected by this.
5. Whilst a shape is stopped the user should be able to change the size, shape, colour and trajectory of the shape (e.g. via a dialog box which pops up when the shape is clicked). You should not allow the attributes of a shape to be changed whilst it is in motion.
6. Allow the user to stop/start all of the shapes by clicking in the background of the animation area.
7. Use off screen images and clipping areas to make the animation smooth
 
Where are you having problems?

Are you unsure about how to use threads?

Will need to be more specific, that is a fairly broad problem there and obviously an assignment of some kind.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top