
  package com.cassiano.performance;

  import java.awt.*;
  import com.ibm.aglet.*;

  public class PerformanceAgletClient extends Aglet {

    // atributos
    private double start, end;
 
    public void run() {	
      Frame f = new Frame(); 	
      PerformanceAglet myPerformance = new PerformanceAgletImpl();
      f.setSize (250, 200);
      f.setTitle ("PerformanceAgletClient");
      try {
        f.setLayout (new GridLayout (3, 1));   
        f.add (new Label ("Trace program : running ...", Label.CENTER));
        f.add (new Label ("Client ID : "+myPerformance.run(), Label.LEFT));        
        f.add (new Label ("Eratosthenes : "+myPerformance.eratosthenes()+" secs", Label.LEFT));               
        f.setVisible(true);
      }           
      catch(Exception e) {
        f.setLayout (new FlowLayout()); 
        f.add (new Label ("Trace program : fail ..."));
        f.setVisible(true);           
      }
      f.addWindowListener (new CloseAndExit());
    } 
         
  }