Paul muellerl wrote:When I use repaint they just draw me the finish picture.
Yes, that's what it's for. Once you read and understand the custom painting tutorial you have a better chance of understanding how to do it right.
AND there can´t be so mutch wrong... it works... the only thing is that there is a flickering.
Maybe that's so, but you can't modify it to do what you want. Instead you have to stop, go back, and start down the right road. To do that it would be best if you read the tutorials which Darryl linked to. And then, write code like the code in those tutorials.
(What I usually do when I'm learning a new Java topic: I go through the tutorial. Then I download the sample code and start changing things in it, so that I am sure I understand it. Then I keep changing things in it until it turns into the code which I originally wanted to write.)
> AND there can´t be so mutch wrong... it works... the only thing is that there is a flickering.
you seem to have a hard time believing what we've been telling you, and it's not a language problem.
here's 2 demo programs to prove to you the problems that will bite you when you least expect it.
1) using Thread.sleep in Swing is a no-no, it blocks painting and listeneing
run this, it will only last 5 seconds, but you cannot close the program in that 5 seconds,
and the label text will not appear until the while loop stops (which is the thread.sleep stopping)
2) getGraphics() is another no-no (generally) in Swing
run this, Hello World will appear, now minimize the frame then immediately restore it,
the text will disappear, as getGraphics() draws once only