java - Make JFrame not repaint -
im trying not repaint window in java. have:
public void paint(graphics g) { super.paint(g); graphics2d g2d = (graphics2d) g; g2d.setrenderinghint(renderinghints.key_antialiasing, renderinghints.value_antialias_on); ball.paint(g2d); }
and in main:
while (true) { game.move(); game.repaint(); thread.sleep(10); }
my jframe window , have tried window.setignorerepaint(true);
there no change. give me hand? thank :)
while (true) { game.move(); game.repaint(); thread.sleep(10); }
must replaced with
timer t=new timer(10,new actionlistener() { public void actionperformed(actionevent e) { game.move(); game.repaint(); } }); t.start();
and override paintcomponent() of content pane.
Comments
Post a Comment