To begin with, get rid of all those silly asterisks and post your code in 'code' tags -- not 'java' tags. Also, post it in the form of a SSCCE (Short, Self Contained, Compilable and Executable) example. Then maybe someone will try it out with a view to help you.Quote:
the only problem is that i don't know what to change in the code
Oh, and remove all that program logic from the paintComponent(...) override. You have absolutely no control over how often or how many times a painting method is called.
@AAnnAA: please don't edit your original post so that the entire problem statement is gone; that renders this thread useless while Google still can find it; other users might look at this thread only to find out that nothing is here anymore.