Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (jean-luc):

How do I make a ball bounce back in the opposite direction in java??

OpenStudy (jean-luc):

please find attached file for the codes

OpenStudy (jean-luc):

|dw:1448032606578:dw|

OpenStudy (jean-luc):

Ball has to move up and down continuously in a straight line

OpenStudy (anonymous):

You set your jframe size to 500 x 500, so you need to know when it y reaches the boundary of the jframe. When it does reach the boundary, change directions. You might want to offset the boundary to compensate for the radius of the ball.

OpenStudy (anonymous):

U need velocity and work with the y axis since its up/down + u need an actionlistnner

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
12 hours ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
15 hours ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Arizona: does anyone know the percentage rate of 30,000 and 40,000
1 week ago 0 Replies 0 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!