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 9003419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:42:35+00:00 2026-06-16T00:42:35+00:00

I am developing application in BlackBerry and i am a newbie, so no idea

  • 0

I am developing application in BlackBerry and i am a newbie, so no idea how to implement.

In my application i have to implement tabs. For this i used pillButtonSet. In my application i have five tabs and each tab has complex view. I want to create different java class for different tabs.

As in Android we have TabActivity and we easily navigate between tabs. Still i have not designed the view for each tabs. I am googling but no success.

I am worried; do i need to write whole code on one screen? …. If not where do i have to create tabs and how to navigate?

  • 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-06-16T00:42:36+00:00Added an answer on June 16, 2026 at 12:42 am

    Take a look at this BlackBerry example from RIM. It’s a bit old, but if you still have to support OS 5.0, it’s a useful technique (see bottom of answer if you don’t support OS 5.0).

    From the description:

    The basic approach is to use a set of Managers to control the sets of
    Fields that appear on the Screen when a tab has been selected. Tabs
    are implemented as focusable LabelFields, with a FocusChangeListener
    doing the Manager switch when focus changes. Fields and Managers are
    initialized once and maintained in memory to retain state changes
    between tabs.

    The page has sample code to download, but to protect against any possible link rot, here’s the most important part of the sample:

    package com.rim.samples.tabcontrol;
    
    import net.rim.device.api.ui.Field;
    import net.rim.device.api.ui.FocusChangeListener;
    import net.rim.device.api.ui.UiApplication;
    import net.rim.device.api.ui.component.BasicEditField;
    import net.rim.device.api.ui.component.LabelField;
    import net.rim.device.api.ui.component.SeparatorField;
    import net.rim.device.api.ui.container.HorizontalFieldManager;
    import net.rim.device.api.ui.container.MainScreen;
    import net.rim.device.api.ui.container.VerticalFieldManager;
    
    public class TabControl extends UiApplication {
    
            public TabControl() {
                    TabControlScreen screen = new TabControlScreen();
                    pushScreen(screen);
            }
    
            /**
             * @param args
             */
            public static void main(String[] args) {
                    TabControl app = new TabControl();
                    app.enterEventDispatcher();
            }
    
            private class TabControlScreen extends MainScreen implements FocusChangeListener {
    
                    private LabelField tab1;
                    private LabelField tab2;    
                    private LabelField tab3;   
                    private LabelField spacer1;   
                    private LabelField spacer2;    
                    private VerticalFieldManager tabArea;    
                    private LabelField tab1Heading;    
                    private BasicEditField tab1Field1;    
                    private BasicEditField tab1Field2;    
                    private LabelField tab2Heading;    
                    private BasicEditField tab2Field1;    
                    private BasicEditField tab2Field2;    
                    private LabelField tab3Heading;    
                    private BasicEditField tab3Field1;    
                    private BasicEditField tab3Field2;
    
                    private VerticalFieldManager tab1Manager;
                    private VerticalFieldManager tab2Manager;
                    private VerticalFieldManager tab3Manager;
    
    
                    public TabControlScreen() {
                            HorizontalFieldManager hManager = new HorizontalFieldManager();
                            tab1 = new LabelField("Page 1", LabelField.FOCUSABLE);
                            tab2 = new LabelField("Page 2", LabelField.FOCUSABLE);
                            tab3 = new LabelField("Page 3", LabelField.FOCUSABLE);
                            spacer1 = new LabelField(" | ", LabelField.NON_FOCUSABLE);
                            spacer2 = new LabelField(" | ", LabelField.NON_FOCUSABLE);
    
                            tab1.setFocusListener(this);
                            tab2.setFocusListener(this);
                            tab3.setFocusListener(this);
                            hManager.add(tab1);
                            hManager.add(spacer1);
                            hManager.add(tab2);
                            hManager.add(spacer2);
                            hManager.add(tab3);
    
                            add(hManager);
                            add(new SeparatorField());
    
                            tab1Manager = new VerticalFieldManager();
                            tab2Manager = new VerticalFieldManager();
                            tab3Manager = new VerticalFieldManager();
    
                            tabArea = displayTab1();
                            add(tabArea);
    
                    }
    
                    public void focusChanged(Field field, int eventType) {
                            if (tabArea != null) {
                                    if (eventType == FOCUS_GAINED) {
                                            if (field == tab1) {
                                                    System.out.println("Switch to Tab 1");
                                                    delete(tabArea);
                                                    tabArea = displayTab1();
                                                    add(tabArea);
                                            } else if (field == tab2) {
                                                    System.out.println("Switch to Tab 2");
                                                    System.out.println("Switch to Tab 1");
                                                    delete(tabArea);
                                                    tabArea = displayTab2();
                                                    add(tabArea);
                                            } else if (field == tab3) {
                                                    System.out.println("Switch to Tab 3");
                                                    System.out.println("Switch to Tab 1");
                                                    delete(tabArea);
                                                    tabArea = displayTab3();
                                                    add(tabArea);
                                            }
                                    }
                            }
    
                    }
    
                    public VerticalFieldManager displayTab1() {
                            if (tab1Heading == null) {
                                    tab1Heading = new LabelField("Registration");
                                    tab1Manager.add(tab1Heading);
                            }
                            if (tab1Field1 == null) {
                                    tab1Field1 = new BasicEditField("Username: ", "");
                                    tab1Manager.add(tab1Field1);
                            }
                            if (tab1Field2 == null) {
                                    tab1Field2 = new BasicEditField("Password: ", "");
                                    tab1Manager.add(tab1Field2);
                            }
                            return tab1Manager;
                    }
    
                    public VerticalFieldManager displayTab2() {
                            if (tab2Heading == null) {
                                    tab2Heading = new LabelField("Password Recovery");
                                    tab2Manager.add(tab2Heading);
                            }
                            if (tab2Field1 == null) {
                                    tab2Field1 = new BasicEditField("Security Question: ", "Mother's Maiden Name?");
                                    tab2Manager.add(tab2Field1);
                            }
                            if (tab2Field2 == null) {
                                    tab2Field2 = new BasicEditField("Password: ", "");
                                    tab2Manager.add(tab2Field2);
                            }
                            return tab2Manager;
                    }
    
                    public VerticalFieldManager displayTab3() {
                            if (tab3Heading == null) {
                                    tab3Heading = new LabelField("Interests");
                                    tab3Manager.add(tab3Heading);
                            }
                            if (tab3Field1 == null) {
                                    tab3Field1 = new BasicEditField("Hobbies: ", "");
                                    tab3Manager.add(tab3Field1);
                            }
                            if (tab3Field2 == null) {
                                    tab3Field2 = new BasicEditField("Memberships: ", "");
                                    tab3Manager.add(tab3Field2);
                            }
                            return tab3Manager;
                    }
    
            }
    
    }
    

    You said:

    I want to create different java class for different tabs.

    In your code, you can edit the methods named displayTab1(), displayTab2(), etc. to return a different class for each tab. Following the example exactly, each class would extend the VerticalFieldManager class. However, if your desired implementation isn’t well setup for a VerticalFieldManager, you could certainly change the return value of those methods to just be the Manager base class, instead.

    Just remember to change the tabArea member variable if you do that:

          private Manager tabArea;    
    

    Note: if you only have to support OS 6.0 and above, you can also look into this newer API

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used Netbeans 7.0 for developing Blackberry application with LWUIT framework. And I'm
I have been developing a BlackBerry application for about 7 months, and I have
I am developing a BlackBerry application that should work on OS 4.5+. I have
We are developing a Java application for BlackBerry. We have the home screen in
i have been working on developing an blackberry application. as per now i want
I am a newbie of Blackberry developing application. I try to store all xml
I'm developing a WebWorks application for the Blackberry Playbook. This page in their documentation
So, my phonegap application has to work on a blackberry with OS 5. This
I am developing blackberry application using BlackBerry JDE 5.0.X , in which i am
I'm developing a blackberry application to remotely access an external customer database. Selected employees

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.