user interaction while animation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pankajs
    New Member
    • Mar 2008
    • 36

    user interaction while animation

    I m facing a problem that when my animation starts the JFrame close button does not work & I have written
    setDefaultClose Operation(JFram e.EXIT_ON_CLOSE );

    and the animation loop is
    public void game()
    {
    while(isVisible ())
    {
    paintworld();
    updateworld();
    try{
    Thread.sleep(20 );
    }
    catch{Interrupt edException e){}
    }
    }
  • BigDaddyLH
    Recognized Expert Top Contributor
    • Dec 2007
    • 1216

    #2
    Animation? Use a timer: http://java.sun.com/docs/books/tutor...isc/timer.html

    Comment

    Working...