Animate Event Example for Visual J++

This example shows how the Animate event can be used to toggle the use of a button to start and stop the animation.

private void LEAD1_animate(Object source, LTOCXU.LEAD.AnimateEvent e)
{
   if( e.bEnable )
      button1.setText( "&Stop Animation" );
   else
      button1.setText( "&Start animation" );
}

private void button1_click(Object source, Event e)
{
   if( LEAD1.getAnimationEnable() )
      LEAD1.setAnimationEnable( false );
   else
      LEAD1.setAnimationEnable( true ) ;
}