FileDocCategorySizeDatePackage
AnimationFrame.javaAPI DocExample796Mon Apr 05 12:08:46 BST 1999None

AnimationFrame

public class AnimationFrame extends ApplicationFrame

Fields Summary
private Label
mStatusLabel
private NumberFormat
mFormat
Constructors Summary
public AnimationFrame(AnimationComponent ac)

    super("AnimationFrame v1.0");
    setLayout(new BorderLayout());
    add(ac, BorderLayout.CENTER);
    add(mStatusLabel = new Label(), BorderLayout.SOUTH);
    // Create a number formatter.
    mFormat = NumberFormat.getInstance();
    mFormat.setMaximumFractionDigits(1);
    // Listen for the frame rate changes.
    ac.setRateListener(this);
    // Kick off the animation.
    Thread t = new Thread(ac);
    t.start();
  
Methods Summary
public voidrateChanged(double frameRate)

    mStatusLabel.setText(mFormat.format(frameRate) + " fps");