Re: move four balls in four differnt directions



Arun dudee wrote:

I need it very urgent if you can help me plz help me and morover its
not related with homework

If you need it very urgent, pay someone for doing your (home)work. Otherwise feel free to learn Swing.

This excercise isn't very hard and can be solved in different ways.

One possibility is to use a datatype that is suitable for storing the required visual informations (e. g. java.awt.Point might be enough) and a custom component which extends javax.swing.JComponent that renders the information on screen. The latter can be done by overriding paintComponent. To animate the whole thing a javax.swing.Timer might be appropriate.

I should stop writing now - otherwise my response might get longer than the solution...

Bye
Michael
.