while Swing , , ( Performed ).
, - , ? Swing Timer class (javax.swing.Timer) , . , Swing . Swing Threading, . - , , . " ".
Re: calling repaint () - this will not work like repaint (), and other methods, such as validate (), etc., will only mark the component that needs to be repainted - the component will not actually be redrawn on the screen until Swing gets a chance to do this, and if you catch the Swing thread in a while loop, it will not be free to take a picture until you finish the loop and the event handling code ends.
source
share