J2ME handing multiple pages

J2ME handing multiple pages

I have 1 midlet and 1 form. How do i make my display of the midlet when users pressed the back command from the form class? Thanks for helping!!

Midlet codes

import javax.microedition.midlet.*; import javax.microedition.lcdui.*;

public class LoginMidlet extends MIDlet implements CommandListener {

private newUser Login;
private Form form;
private Display display;
private TextField username, pwd;
private Command login;
private Ticker welcome;

public void startApp() {

    form = new Form("Welcome");
    welcome = new Ticker("Advertisments");
    form.setTicker(welcome);
    username = new TextField("Username :", null, 40, TextField.ANY);
    pwd = new TextField("Password :", null, 20, TextField.PASSWORD);
    form.append(username);
    form.append(pwd);
    login = new Command ("Login",Command.OK,1);
    form.addCommand(login);
    form.setCommandListener(this);
    display = Display.getDisplay(this);//get the display manager
    display.setCurrent(form);
}

public void commandAction(Command c, Displayable d) {
    if (c == login) {
        Form Login = new newUser("Register Account");
        display = Display.getDisplay(this);
        display.setCurrent(Login);
    }

}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}

} Form class

import javax.microedition.midlet.*; import javax.microedition.lcdui.*;

public class newUser extends Form implements CommandListener {

private LoginMidlet midlet;
private Display display;
private StringItem welcome;
private Form form;
private Command cmdRegister, cmdBack;
private TextField username, password, email, address, mobile, confirmPassword;

public newUser(String title) {

    super(title);
    this.welcome = new StringItem(null, "Please enter the following information ");
    append(this.welcome);
    this.username = new TextField("Username :", null, 40, TextField.ANY);
    this.password = new TextField("Password :", null, 20, TextField.PASSWORD);

    append(this.username);
    append(this.password);

    this.cmdRegister = new Command("Register", Command.OK, 1);
    this.cmdBack = new Command("Back", Command.BACK, 0);
    addCommand(this.cmdBack);
    addCommand(this.cmdRegister);
    this.setCommandListener(this);
}

public void commandAction(Command c, Displayable d) {
    String label = c.getLabel();
    if (label.equals("Back")) {
        this.display = Display.getDisplay(this.midlet);




    }
    if (label.equals("Register")) {
    }
}

}

View Answers









Related Tutorials/Questions & Answers:
J2ME handing multiple pages
J2ME handing multiple pages  I have 1 midlet and 1 form. How do i make my display of the midlet when users pressed the back command from the form class? Thanks for helping!! Midlet codes import javax.microedition.midlet.
J2ME Read Multiple File - MobileApplications
J2ME Read Multiple File  Hello I have read a topic "J2ME Read File", but that example is specify for a single file, but what if i want read more file one after the other just like Books. And an example will i appreciate thanks
Advertisements
j2me
j2me  i need more points about j2me
j2me
j2me  how to compile and run j2me program at command prompt
j2me
j2me  why we extends class MIDlet in j2me application
j2me
j2me  I need fifth sem MCA mobile computing lab programs using j2me. i m beginner for j2me and i want to know how to run j2me programs. pls help
j2me
j2me  how to use keylistener in j2m
j2ME
j2ME  give a sample example for using key listener in j2ME for developing Symbian
J2ME
J2ME  Hi, what is the source code for Mortgage Calculator in J2ME for Developing Symbian
J2ME
J2ME PROGRAM TO CONNECT WITH MS-ACCES  HI WRITE A J2ME PROGRAM TO CONNECT WITH MS-ACCESS.(CREATING DATABASE) THANKS
J2me
J2me  How to run j2me program in Wireless tool kit   Hi Friend, Please visit the following link:ADS_TO_REPLACE_1 J2ME Tutorials Thanks
j2me
j2me  hi, in j2me does any click events for developing Symbian.? and How to add click event for dynamically generated button in j2me on Symbian OS
J2ME
J2ME  WHEN WILL repaint() of CustomItem will call automatically
J2ME
J2ME  how to create table using four field in RMS
J2ME
J2ME  Dear Sir, Am beginner of j2me am asking so many times but still now i didn't get a reply for you...I want source code to scan a image and upload to server in j2me also QR Code decoding in j2me thanks and regards
j2me
j2me  hi, i'm working emulator in j2me language, for Symbian OS (Nokia) development. then, what are the click events in this for developing the application.? Thank you
j2me
j2me  Hi, how can add image in forms but using lick a button. does not using canvas in j2me for Symbian development
j2me
j2me  hi, how to use LWUIT in emulator J2me for Symbian OS? and also how to install in emulator, did worked
j2me
j2me  in j2me i want to know how to acess third form from the second form.... so need a program for example with more thaan three form
J2ME
J2ME  how to accept time in textField using constraints in case of J2ME   Hello Friend, Please visit the following link: http://www.roseindia.net/j2me/date-field.shtml Thanks
J2ME
J2ME  how to change the color of the selected date using J2ME. i.e. if i press select by taking the cursor on the date ,the color of that digit should change
J2ME
J2ME  Hi friends, i have display the bar code image from Mysql database to web page i need to display that image in my J2ME application,how
j2me
j2me  hey i m doing a project can i create message reader using j2me in nokia phone?? pls give me source code or hint
j2me
j2me  in j2me i want to know how to acess third form from the second form.... so need a program for example with more thaan three form
J2ME
J2ME  how to use form and canvas is same screen in J2ME   Hi Friend, Please visit the following link: http://www.roseindia.net/j2me/CanvasForm.shtml Thanks
J2ME
J2ME  hi i am just stared j2me learning. can you please tell me how to put radio button and textFiled at same row
j2me
j2me  COmmand c=new Command("Exit",Command.EXIT,100);Please expalin abt 3 parameters
J2ME
J2ME  how to get the color of a pixel in J2ME but not in Java... J2ME. I am using Canvas. I needed to know, if there is any method to get... line using J2ME
J2ME
J2ME  Hi sir, i need a source code for simple calculator along with buttons in mobile application
J2ME
J2ME  i am working in j2ME language on Symbian OS S60 (Nokia)application in this application i am adding buttons for designing in MIDlet application. so how to add button in dynamically. and how can place lancher icon also
J2ME
J2ME -i want to execute j2me program using sun wireless tool kit 2.5.2 pls suggest me which WTK for 64 bit operating system  hello sir, i am using windows 7 64 bit in my laptop...,i want to execute j2me program using sun wireless
j2me
j2me  i want code in which when we input same data in midlet page ... than on ok button it will show in servlet page.. code that pass information to mobile application page to servlet page
j2me
j2me  i want code in which when we input same data in midlet page ... than on ok button it will show in servlet page.. code that pass information to mobile application page to servlet page
J2ME
J2ME  What is the source code for Mortgage Calculator. using text fields are home price,loan amount,down payments,down payment percent, Annual tax... in J2ME language for Symbian developing. so please help me
j2me
j2me   Hi, In my j2me application I have used canvas to display an image in fullscreen.In the image there are four points( rectangular areas ). Now I have to add events to these points. It looks like that those areas will be used
j2me
j2me  Hi, i'm working eclipse j2me for Symbian development. i want a combo box use like a scroll bar type. when we are using combo box to a column it acts as one combobox for all cells in a column but i nedd separate combobox
j2me
j2me  hi i'm a java beginner and i am working in j2me. i am using java wireless tool kit and java sdk. and the problem is that i am not getting the out put in the java sdk. for the source code provided by you. please give me
j2me
j2me  What is JAD file what is necesary of that   Hi Friend, Please visit the following link:ADS_TO_REPLACE_1 JAD File Thanks   Hi Friend,ADS_TO_REPLACE_2 Please visit the following link: JAD File
j2me
j2me  Hi,i create a project using lwuit in netbeans 6.9 for motorola MC75 device i want to know how can i connect this application with remote server,should i use servlets.actually i have to send data in xml format and also
J2ME
J2ME  i wann source code to find out the difference between two dates.. and i wan in detail.. plz do favour for me..   import java.util.... (ParseException e) { e.printStackTrace(); } } }   i wann j2me code
Sitemap J2ME Tutorial
Multiple Type List in J2ME | J2ME Ticker | J2ME Thread Processing  | Draw... Map | Business Software Services India J2ME Tutorial Section Java Platform Micro Edition | MIDlet Lifecycle J2ME | jad and properties file
j2me application
j2me application  code for mobile tracking system using j2me
j2me QUE
j2me QUE  Iam New for j2me .plz tell me how to compile and run j2me program and what software needed fot
J2me - MobileApplications
J2me  How to connect JDBC with MIDP
j2me program
j2me program  how to run j2me program?what setting is to do whem we run j2me programs?   Please go through the following link: J2ME Tutorials
j2me - MobileApplications
j2me  Hi, How can we get google maps through j2me
J2ME - MobileApplications
J2ME  How can we create a grid of controls on J2ME with different image present on each control
J2ME Thread Processing Example
J2ME Thread Processing Example       In the given example, you will learn about the thread and how thread works in J2ME application. An application can run multiple activities
jsp pages
jsp pages  I am using 3 jsp pages in an application.. 1.login.jsp 2.checkuser.jsp:is connected to databse..from this page im giving path to search.jsp 3.search.jsp:Here we need fetch data from data base..do u want to connect
HTML pages.
HTML  pages. Description : HTML is a hypertext markup language. Every HTML page has two part one head part another is body. It will  run on browser. Anything available in head will not display on browser. Body part is used

Ads