April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
Exemplo J2ME (cont.)
n    // Sintax: Command("Name", Type, Priority)
n    exitCommand  = new Command("Exit", Command.EXIT, 1);
n    backCommand  = new Command("Back", Command.BACK, 1);
n    aboutCommand = new Command("About", Command.SCREEN, 2);
n    propsCommand = new Command("SysProps", Command.SCREEN, 2);
n   
n    // First Display shows List options
n    String  stringElements[] = { "About", "System Properties", "Alert" };
n    list = new List("Título", List.IMPLICIT, stringElements, null);
n    list.addCommand(exitCommand);
n
n    // Sintax: TextBox("Title", "Initial text", NrChars, Validations)
n    textBox = new TextBox("HelloWorldMIDlet", "Hello World MIDlet Example ...",256,0);
n    textBox.addCommand(exitCommand); textBox.addCommand(propsCommand);
n    textBox.addCommand(backCommand);
n   
n    // Form info
n    props = new Form("System Properties");
n    props.addCommand(exitCommand); props.addCommand(aboutCommand);
n    props.addCommand(backCommand);
n   
n    // Alert Message
n    alert = new Alert("Hello Alert", "Testing Alert ...", null, AlertType.INFO);
n  }