Skip to main content

repaint() or update(a.getGraphics())

No replies
82kolu
Offline
Joined: 2012-12-09
Points: 0

Hey guys,
I have a Problem.
I made a grafic with a Menubuttom a Obtionbutton and so on... further I made a moving object into my Window.

Now when I run my class. The options bar flickers.
How can i fix this?

				for (int i = 0; i < 70; i++) {					
wX = wX + abstand;
if (wX + 50 >= (int) w1.breite()) {
wX = (int) w1.breite() - 30;

fertig2 = 50*(j+1) - (ueberlappung*(j));
break;
}
// a.update(a.getGraphics());
repaint();
try {
Thread.sleep(100);
} catch (InterruptedException e) {

e.printStackTrace();
}
}
}