Advertisement
magoo123

Untitled

Oct 12th, 2011
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. package onlinecontactbackup;
  2.  
  3. import javax.microedition.lcdui.*;
  4. import javax.microedition.midlet.*;
  5.  
  6. public class MainMenuScreen extends MIDlet implements CommandListener {
  7.  
  8. private Display display;
  9.  
  10. private Command exitCommand = new Command("Exit",Command.EXIT,1);
  11. private Command NewUserCommand = new Command("New User",Command.SCREEN,1);
  12. private Command LoginCommand = new Command("Login",Command.SCREEN,2);
  13.  
  14. private Form form;
  15.  
  16. private TextField Full_Names;
  17. private TextField User_Name;
  18. private TextField E_Mail;
  19. private TextField Pass_Word;
  20. private TextField Verify_Password;
  21.  
  22. private TextField txtInput;
  23.  
  24. public MainMenuScreen(){
  25.  
  26. // txtInput = new TextField("Enter Your Full Names:","",30,TextField.ANY);
  27. // txtInput = new TextField("Create user name:","",30,TextField.ANY);
  28. // txtInput = new TextField("Enter Email:","",30,TextField.ANY);
  29.  
  30. // txtInput = new TextField("Enter Password:","",30,TextField.PASSWORD);
  31. // txtInput = new TextField("Re Enter Password:","",30,TextField.PASSWORD);
  32.  
  33. form = new Form("Manage Phone Book Account");
  34.  
  35. // form.append(txtInput);
  36.  
  37. form.addCommand(exitCommand);
  38.  
  39. form.addCommand(NewUserCommand);
  40.  
  41. Full_Names = new TextField("Enter Your Full Names:","",30,TextField.ANY);
  42. User_Name = new TextField("Create user name:","",30,TextField.ANY);
  43. E_Mail = new TextField("Enter Email:","",30,TextField.ANY);
  44.  
  45. Pass_Word = new TextField("Enter Password:","",30,TextField.PASSWORD);
  46. Verify_Password = new TextField("Re Enter Password:","",30,TextField.PASSWORD);
  47.  
  48. form.append(Full_Names);
  49. form.append(User_Name);
  50. form.append(E_Mail);
  51.  
  52. form.append(Pass_Word);
  53. form.append(Verify_Password);
  54.  
  55. form.setCommandListener(this);
  56.  
  57. form.addCommand(LoginCommand);
  58.  
  59. txtInput = new TextField("User Name:","",30,TextField.ANY);
  60. txtInput = new TextField("Password:","",30,TextField.PASSWORD);
  61.  
  62. form.setCommandListener(this);
  63. }
  64.  
  65. public void initMidlet(){
  66. display = Display.getDisplay(this);
  67. display.setCurrent(form);
  68. }
  69.  
  70. public void ExitMidlet() throws MIDletStateChangeException{
  71. destroyApp(true);
  72. notifyDestroyed();
  73. }
  74.  
  75. public void commandAction(Command c, Displayable d) {
  76. if(c==exitCommand){
  77. try {
  78. this.ExitMidlet();
  79. } catch (MIDletStateChangeException e) {
  80. // TODO Auto-generated catch block
  81. e.printStackTrace();
  82. }
  83. }
  84.  
  85. if(c==NewUserCommand){
  86. String input = txtInput.getString();
  87. }
  88.  
  89. else if(c==LoginCommand){
  90. String input = txtInput.getString();
  91. }
  92. }
  93.  
  94. protected void destroyApp(boolean unconditional) throws MIDletStateChangeException {
  95. // TODO Auto-generated method stub
  96.  
  97. }
  98.  
  99. protected void pauseApp() {
  100. // TODO Auto-generated method stub
  101.  
  102. }
  103.  
  104. protected void startApp() throws MIDletStateChangeException {
  105. if(display==null){
  106. initMidlet();
  107. }
  108.  
  109. }
  110.  
  111.  
  112. }
  113.  
  114.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement