Java Applet


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

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.



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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center