I'm trying to make moving ball animation in Swing, but I don't know how. Can anybody help with this? I was reading about threads, but I didn't understand a lots of it...
Patel Chintan
Ranch Hand
Joined: Mar 01, 2007
Posts: 80
posted
0
If you just need to make animation for moving ball, then you don't need to use mutithreading. You can achieve this just using repaint method.
You just need to decide path for Ball, and keep repainting the ball.
Hi, guys! I have been dealing with this problem and wrote this code:
This is code just for JPanel on which is my work drawn and it is then called from the JApplet. I would like to make 3 balls (from 5 of them) to get in horizontal line and to wait a moment simulating people waiting on 3 information desks. I hope I didn't explain too confusing
P.S. If you thing that I should make new topic for that problem, just say and I'll do it
Yes, I saw when I removed it And what about my question - about making 3 balls to stop in line and to wait a little bit? Any idea...?
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32675
4
posted
0
What books do you have access to? There is an example in Horstmann and Cornell (I have the 6th edition myself and it is in the 1st chapter in vol II), which sounds quite like what you are doing.
I would have thought the other books would have similar examples, so try your library.
maja neskovic
Ranch Hand
Joined: Apr 28, 2010
Posts: 134
posted
0
I have only Java in 21 days, but there is nothing about my problems... Would you be kind to send me that book on email?