> I have to make a small game using swing in which i have to move 4
> balls starting from to four differnt direction like east west north
> south and then back to center using canvas.
java.awt.Canvas is part of the AWT.
> i am new swing plese help me.
So, what code do you have so far?
> i need it very urgent plz help me.
The homework is overdue, is it?
Andrew T.
Arun dudee - 26 Feb 2007 07:09 GMT
> > I have to make a small game using swing in which i have to move 4
> > balls starting from to four differnt direction like east west north
[quoted text clipped - 11 lines]
>
> Andrew T.
I need it very urgent if you can help me plz help me and morover its
not related with homework
Michael Rauscher - 26 Feb 2007 08:48 GMT
> 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