This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes Using threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Using threads" Watch "Using threads" New topic
Author

Using threads

Michael Chapman
Greenhorn

Joined: Oct 26, 2006
Posts: 2
Hi everyone,

I would really appreciate your help with a program that has been bugging me for over a week now.

Essentially I am using threads to control balls within a Jframe (10 balls). When i click within the frame the balls start their motion again from this point. There is also a 10 pixel wide invisible line down the center of the frame that the ball rebound off when they hit it.

What i would like to achieve is for the balls to rebound of the wall if they are designated as even as stick to the wall if they are odd. I have worked out that I will need to use a modulo such as i%2==1 to work out whether it is odd for example.

I would appreciate your time and suggestions.

(there is a 'ball' class that I have not included so as to keep the problem area as concise as possible)

Michael Chapman
Greenhorn

Joined: Oct 26, 2006
Posts: 2
Please take a look someone!

Thanks
Virag Saksena
Ranch Hand

Joined: Nov 27, 2005
Posts: 71
It might help if you are a bit more specific about the issue you are facing


<a href="http://www.auptyma.com" target="_blank" rel="nofollow">The Peak of Performance</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using threads
 
Similar Threads
Need help breaking up this code
Defining the exact bottom of panel for graphic component
Using Threads
Implementing multiuser interactive animation with RMI callbacks.
exception java.lang.InterruptedException is never thrown in body of corresponding try statement