×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Question How to set Form to Back in LWUIT??

    Is it possible to set the form to back in LWUIT.
    Let i have Form1 and Form2.
    Form1 switches to Form2 which has back Command. On the click of Back Command it will move to Form1 again.
    Form1 has Labels and Textfields

    Please Reply.
    Regards
    Rajan Verma

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: How to set Form to Back in LWUIT??

    Quote Originally Posted by rajan701v View Post
    Is it possible to set the form to back in LWUIT.
    Let i have Form1 and Form2.
    Form1 switches to Form2 which has back Command. On the click of Back Command it will move to Form1 again.
    Form1 has Labels and Textfields

    Please Reply.
    This is very basic thing that is required in most of the apps. You can set the form2 as the current displayable on the back command action inside the actionPerformed()

    This is how you can move ahead,
    PHP Code:
    public void actionPerformed(ActionEvent ae) {
         
    Form current Display.getInstance().getCurrent();
         if (
    current == mFirstForm) {
          
    mSecondForm.show();
         } else if (
    current == mSecondForm) {
          
    mFirstForm.show();
         }
        } 
    In this code you can put the command events and change the displayable.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: How to set Form to Back in LWUIT??

    Quote Originally Posted by raj_J2ME View Post
    This is very basic thing that is required in most of the apps. You can set the form2 as the current displayable on the back command action inside the actionPerformed()

    This is how you can move ahead,
    Code:
    public void actionPerformed(ActionEvent ae) {
         Form current = Display.getInstance().getCurrent();
         if (current == mFirstForm) {
          mSecondForm.show();
         } else if (current == mSecondForm) {
          mFirstForm.show();
         }
        }
    In this code you can put the command events and change the displayable.
    thanks a lot for the reply. Will it work like Back commnad as in LCDUI Command.BACK

    Please Reply.
    Last edited by wizard_hu_; 2013-08-02 at 14:30. Reason: PHP->CODE
    Regards
    Rajan Verma

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: How to set Form to Back in LWUIT??

    Quote Originally Posted by rajan701v View Post
    thanks a lot for the reply. Will it work like Back commnad as in LCDUI Command.BACK

    Please Reply.
    Yeah, just you have to provide the proper command action, what you wanna do..it will work,
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Question Re: How to set Form to Back in LWUIT??

    Quote Originally Posted by raj_J2ME View Post
    Yeah, just you have to provide the proper command action, what you wanna do..it will work,
    Thanks raj. I followed your steps. But when i goes back to the previous form, all the components, command are removed and Screen is blank . What should i do for this.

    Please Reply.
    Regards
    Rajan Verma

  6. #6
    Registered User
    Join Date
    Sep 2007
    Location
    Bangalore
    Posts
    868

    Re: How to set Form to Back in LWUIT??

    Hi rajan701v ,

    In the process of the setting the form back you are clearing the previously added components some where . Please make sure like you are not removing the commands and the item in that form . Or you might be creating the new instance of the form.

  7. #7
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Question Re: How to set Form to Back in LWUIT??

    Quote Originally Posted by bhanuchandar.k View Post
    Hi rajan701v ,

    In the process of the setting the form back you are clearing the previously added components some where . Please make sure like you are not removing the commands and the item in that form . Or you might be creating the new instance of the form.
    Thanks i got the solution.
    Regards
    Rajan Verma

Similar Threads

  1. pass Text field value from one form to another form in LWUIT.
    By debasish_cse05 in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2011-01-13, 11:21
  2. problem in back and forth of LWUIT form and normal form in j2me
    By jugal.inani in forum Mobile Java General
    Replies: 8
    Last Post: 2010-06-09, 12:24
  3. need to put canvas in LWUIT Form
    By yatin.frankline in forum Mobile Java General
    Replies: 5
    Last Post: 2010-04-05, 13:23
  4. want to open form when back to first ap , how?
    By nokia_lin in forum Symbian User Interface
    Replies: 0
    Last Post: 2009-04-15, 02:41
  5. How to use replace method of LWUIT form?
    By neeraja.nokia in forum Mobile Java General
    Replies: 0
    Last Post: 2009-01-24, 04:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×