Forums Login/signup

noob needs paint help

+Pie Number of slices to send: Send
hi,

this is some code taken from the net, modified a bit, that I'm trying to understand. The idea is to bounce a ball. Currently the ball bounces in a continuous line, but I can't see where I'm messing up.

thanks for your time
+Pie Number of slices to send: Send
Some very old-fashioned looking code there, with _x and _y. That is an acceptable format in C, but not considered correct style in Java.
And some odd features like an empty catch and a SUID of 1L. Also using thread priorities (which is probably unnecessary) may lose portability.

Try super.paint(g); as the first line of the paint() method.

reply
reply
This thread has been viewed 1145 times.
Similar Threads
multiple painting components
C++ish Address &
problem of MediaTracker and paint(Graphics)
When I use MediaTracker , the method "paint(Graphics)" will be invoked ceaselessly!!
paint/paintComponent
More...

All times above are in ranch (not your local) time.
The current ranch time is
Jun 28, 2025 02:42:45.