List of usage examples for java.awt Frame repaint
public void repaint()
From source file:net.fenyo.gnetwatch.GUI.AwtGUI.java
/** * Refreshes the frames regularly./* w w w. j a v a2 s. c o m*/ * @param none. * @return void. */ // repaint thread public void run() { int cnt = 0; while (!config.isEnd()) try { Thread.sleep(20); cnt++; synchronized (frame_list) { for (final Frame frame : frame_list) { final BasicComponent component = ((BasicComponent) ((JFrame) frame).getContentPane() .getComponent(0)); if ((component.isManualMode() == false && component.pixelsOffsetChanged() == true) || cnt == 50) frame.repaint(); } } if (cnt == 50) cnt = 0; } catch (final InterruptedException ex) { // this thread is interrupted when the application is terminated } }