Hello everyone!
first of all I'd like to say that this is my very first post ever on a
forum and I might be asking the question on the wrong one :( if so
please forgive me. But otherwise I'd like to take this opportunity to
absorb a little bit of your knowledge :).
I am trying to program a little arcanoid game, and though I've only
written 7 lines of code I'm already stuck :(.
I have a class for the main program which consists of a JFrame where
the background is drawn. I also have a ball class, in general I though
of it as having a moveBall method that accepts two ints (a x and a y)
and draws the fillOval into the main window.
Unfortunetly I couldn't come up with an idea of how to make this
particular ball class to draw on the main class (different class).
Any ideas on how I could approach this would be greatly accepted
Harald Hein - 02 Dec 2003 05:35 GMT
> I have a class for the main program which consists of a JFrame
> where the background is drawn. I also have a ball class, in
> general I though of it as having a moveBall method that accepts
> two ints (a x and a y) and draws the fillOval into the main
> window.
This is an FAQ. You don't do that. You do not paint from the outsite to
a window. Read the FAQ (if you can find it). Also read the GUI tutorial
on Sun's web site.