FileDocCategorySizeDatePackage
Daytime.javaAPI DocExample887Thu Feb 16 11:05:52 GMT 2006None

Daytime

public class Daytime extends MIDlet

Fields Summary
Constructors Summary
public Daytime()

        
    Form form = new Form("Network Time");
    InputStream in = null;
    try {
      in = Connector.openInputStream("socket://time-a.nist.gov:13");
      StringBuffer sb = new StringBuffer();
      for (int c = in.read(); c != -1; c = in.read()) {
        sb.append((char) c);
      }
      form.append(sb.toString());
    }
    catch (IOException ex) {
      form.append(ex.getMessage());
    }
    finally {
      try {
        if (in != null) in.close();
      }
      catch (IOException ex) { /* Oh well. we tried.*/ }
    }
 
    Display.getDisplay(this).setCurrent(form);
  
Methods Summary
public voiddestroyApp(boolean unconditional)

public voidpauseApp()

public voidstartApp()