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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -