DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Thread: Java Applet

  1. #1
    Mounir Guest

    Java Applet


    How can i stop an Animation when the Program still works under a FOR statement--->for
    (i=0;i<1000;e++).
    I have Start Button
    And Stop Button.
    I want to clear directly the Animation, not untill the for-Statement finisched.

  2. #2
    Hiranya Samarasekera Guest

    Re: Java Applet


    Use the break; statement inside the for loop.

    In the sample code that you have provided, (i) variable doesn't get incremented
    instead (e) gets incremented. [I'm not sure sometimes u may have incremented
    the (i) var inside the loop ]

    Hiranya Samarasekera
    [www.theFutureMinders.com]
    ----------------------------------


    "Mounir" <abbas@gmx.de> wrote:
    >
    >How can i stop an Animation when the Program still works under a FOR statement--->for
    >(i=0;i<1000;e++).
    >I have Start Button
    >And Stop Button.
    >I want to clear directly the Animation, not untill the for-Statement finisched.



  3. #3
    Ahmad Q. K. Guest

    Re: Java Applet


    "Mounir" <abbas@gmx.de> wrote:
    > Dear;

    do not use "for loop" in the main thread for animation, because it will block
    the System, rather make a new thread which will handle the animation

    >How can i stop an Animation when the Program still works under a FOR statement--->for
    >(i=0;i<1000;e++).
    >I have Start Button
    >And Stop Button.
    >I want to clear directly the Animation, not untill the for-Statement finisched.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links