Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 662061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:20:11+00:00 2026-05-13T23:20:11+00:00

hey in my screen there is a an edit field and 2 custom button

  • 0

hey in my screen there is a an edit field and 2 custom button fields as “OK” and “CANCEL”
Below buttonfield there are some more focussable label fields

when i write a name in edit field and press enter then focus comes to “OK” button but how to set focus on “CANCEL” button.

Moreover while scrolling the focus does not automatically move ahead???

what to do may be i m confused with touch events and their handling!!!

Kindly help!!!!!!!!!!!!

Code:

        txt_Name = new EditField(TextField.NO_NEWLINE)
            {
                public void paint(net.rim.device.api.ui.Graphics g)
                {
                    g.setColor(Color.MAROON);
                    super.paint(g);
                }
           };

            txt_Name.setFont(font);

     v1 =  new VerticalFieldManager();
     v1.add(txt_Name );


    ButtonField btn1 = new ButtonField("OK",ButtonField.CONSUME_CLICK);
    ButtonField btn2 = new ButtonField("CANCEL",ButtonField.CONSUME_CLICK);

     v2 =  new VerticalFieldManager();
     v2.add(btn1);
     v2.add(btn2);

    LabelField l1 = new  LabelField("Hello Moon ",Field.Focussable);
    LabelField l2 = new  LabelField("Hello Citizen",Field.Focussable);
    LabelField l3 = new  LabelField("Hello People",Field.Focussable);
    LabelField l4 = new  LabelField("Hello world",Field.Focussable);

     v3 =  new VerticalFieldManager();
     v3.add(l1);
     v3.add(l2);
     v3.add(l3);
     v3.add(l4);

    add(v1);
    add(v2);
    add(v3);
}


protected boolean navigationClick(int status, int time) 
    {
     if(OK.isFocus())
             {
                //execute some code
                return true;
             }
if(CANCEL.isFocus())
             {
                //execute some code
                return true;
             }
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:20:12+00:00Added an answer on May 13, 2026 at 11:20 pm
        txt_Name = new EditField(TextField.NO_NEWLINE)
                {
                    public void paint(net.rim.device.api.ui.Graphics g)
                    {
                        g.setColor(Color.MAROON);
                        super.paint(g);
                    }
               };
    
                txt_Name.setFont(font);
    
         v1 =  new VerticalFieldManager();
         v1.add(txt_Name );
    
    
        ButtonField btn1 = new ButtonField("OK",ButtonField.CONSUME_CLICK);
        ButtonField btn2 = new ButtonField("CANCEL",ButtonField.CONSUME_CLICK);
    
         h2 =  new HorizontalalFieldManager();
         h2.add(btn1);
         h2.add(btn2);
    
        LabelField l1 = new  LabelField("Hello Moon ",Field.Focussable);
        LabelField l2 = new  LabelField("Hello Citizen",Field.Focussable);
        LabelField l3 = new  LabelField("Hello People",Field.Focussable);
        LabelField l4 = new  LabelField("Hello world",Field.Focussable);
    
         v3 =  new VerticalFieldManager();
         v3.add(l1);
         v3.add(l2);
         v3.add(l3);
         v3.add(l4);
    
        add(v1);
        add(h2);
        add(v3);
    }
    
    
    protected boolean navigationClick(int status, int time) 
        {
    int index = h2.getFieldwithFocusIndex();
         if(h2==0)
                 {
                    //execute some code for OK
                    return true;
                 }
    if(h2==1)
                 {
                    //execute some code for cancel
                    return true;
                 }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I'm having some trouble with a screen from the app I'm developing.
hey i have displayed a pop-up screen when i click on a menu item
Hey so I'm building an iOS app. The fist window is a login screen
Hey there, I have the following code: sVal = analogRead(potPin); // read the value
Hey guys, I am working on a game, and wanted to add a screen
hey there, just practising and I had a question. I have a program (source
Hey all, I've created a loading/splash screen that loads at the beginning of my
Hey I need to get the width of the screen in my application. The
Hey Im writing a launcher, in which Im building my own custom lockscreen. the
Hey team i am new to android and building an application in which there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.