Ok, Good luck.
Type: Posts; User: Norm
Ok, Good luck.
One more bug out. Maybe three left.
Then a big redesign.
And I assume that the one balll moved as expected. Is that correct?
Now run the test with two balls.
Did you read post#30?
You can make assumptions and/or you can add printlns and look at the output and see if there is a pattern when a ball looks like it is "trapped on one side".
What are the values of the balls...
Back to printing out the values of the balls positions. Only test with two balls to keep it simple. You might try changing the size of the window and the speed that the balls move for easier...
Can you describe what the messed part is now? After a few code changes, it could be acting differently than it was.
Yes that looks right. Also you could get rid of the creation of the thread: ball = new Thread...
The Thread was created and started in another place in your code.
If you only started one ball by clicking one time with the mouse, then why is the run method called two times? Do you wonder why you got two lines printed out?
It looks like you are creating and...
Should run be called twice every time a new ball is added?
How many threads are supposed to be running for a ball?
Run the test and only add one ball. How many threads are shown by the print out?
public void run()
{
System.out.println("run for " + Thread.currentThread().getName()); //<<<<<
while(true)
{
Add this println to your code as shown above and execute it.
What is printed out by the printlns you put in the run method?
Are the print outs what you expected?
Pretty boring. When posting long repeating group, use ... in the middle.
You print outs don't show a lot of things about your program.
One thing they do show is that there is only one delta value....
Post your printed output and I point out where the problems are.
Or I'll tell you where you should add more print outs to see the problem.
Sorry, I don't understand what that means.
So far I have found two problems by adding printlns and looking at the output.
How are you doing?
Your code has very few comments describing its logic. It will take a long time to figure out what you are trying to do.
Have you tried debugging it by adding lots of println statements to show the...
What is the problem then? Can you explain?
Please post any code you are asking questions here on the forum.
Your post wasn't anything useful. If you need to copy the console:
To copy the contents of the command prompt window:
Click on Icon in upper left corner
Select Edit
Select 'Select All' - The...
You could write a loop to access the elements vs having the elements individually coded.
Have the loop variable index the first dimension of the array.