Sorry i dont understand how i can override paintcomponent from within the thread, surely you have to set public methods and variables within the paintcomponent to modify it from an altogether...
Type: Posts; User: shadysback
Sorry i dont understand how i can override paintcomponent from within the thread, surely you have to set public methods and variables within the paintcomponent to modify it from an altogether...
Unfortunately thats a pre-requisite that i have to have each ball controlled by its own runnable/thread,
If i can ask one last question, i am trying to make a frame full of bouncing balls, i.e. each ball controlled by their own runnable, which bounce off the window panes. What would be a good layout...
It works!!! BTW i was trying out FlowLayout before you suggested GridLayout, and none of the components were showing on the frame. Do you have any idea why?
Hi i think i found out where i was going wrong. I was adding the component directly to the frame (refer to BallsFrame.java). I think you can only add one component directly to a frame.
Sorry about that. Here is the various pages of the program:
Hi i tried to make a small version of the program but i couldnt change classes into methods etc, as i am quite new at java. Heres a project folder from netbeans which contains all the source.
Sorry...
Hey Guys,
I am creating a program which creates two balls (each with their own runnables which control them). This is the important code from the file:
public BallsFrame() {
...