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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:12:36+00:00 2026-05-31T04:12:36+00:00

Hi friends I got sample code for Pane Manager from blackberry samples but when

  • 0

Hi friends I got sample code for Pane Manager from blackberry samples but when i run that sample and double click on tabs ,menus appear .I don’t want to show that menus on click.how to do it.please tell me why this is happening? i am not understanding the code.Please help

public class PaneManagerDemo extends UiApplication
{ 
/**
 * Entry point for the application
 * @param args Command line arguments (not used)
 */
public static void main(String[] args)
{
    UiApplication app = new PaneManagerDemo();
    app.enterEventDispatcher();
}


/**
 * Creates a new PaneManagerDemo object
 */
public PaneManagerDemo()
{      
    invokeLater(new Runnable()
    {
        public void run()
        {
            int headerType = 0;
            // Display a dialog for user to select header type
            OptionDialog dialog = new OptionDialog();
            int result = dialog.doModal();
            if(result == Dialog.OK)
            {
                headerType = dialog.getHeaderType();
            }
            else if(result == Dialog.CANCEL)
            {
                System.exit(0);
            }   
            //PaneScreen screen = new PaneScreen(headerType);
            PaneScreen screen = new PaneScreen(headerType);
            pushScreen(screen);
        }
    });        
}


/**
 * A dialog popup used to choose a header type
 */
private static class OptionDialog extends Dialog
{        
    public static final int SCROLL_HEADER_TYPE = 0;
    public static final int TAB_HEADER_TYPE = 1;

    private ObjectChoiceField _choiceField;     

    /**
     * Create a new HeaderDialog object
     */
    public OptionDialog()
    {
        super(Dialog.D_OK_CANCEL, "Choose Header Type", Dialog.OK, null, Dialog.GLOBAL_STATUS);
        _choiceField = new ObjectChoiceField("", new String[]{"Scrollable", "Tab"}, 0);
        add(_choiceField);            
        _choiceField.setFocus();
    }


    /**
     * Returns an integer representing the header type
     * 
     * @return SCROLL_HEADER_TYPE if scrollable header selected, TAB_HEADER_TYPE if tab header selected
     */
    public int getHeaderType()
    {
        return _choiceField.getSelectedIndex();
    }
}


/**
 * Main screen for the application. Displays three panes
 * switchable via horizontal scroll field or tabs, depending
 * on user selection.
 */
private final static class PaneScreen extends MainScreen
{   
    /**
     * Creates a new PaneScreen object
     * @param headerType The header type for the PaneManager, scrollable or tab style 
     */
    public PaneScreen(int headerType)        
    {
        super(Field.FOCUSABLE);                       

        // Instantiate the model for the pane manager and enable looping
        PaneManagerModel model = new PaneManagerModel();
        model.enableLooping(true);

        // Create a pane
        VerticalFieldManager vfm = new VerticalFieldManager();
        vfm.add(new LabelField("Data 1"));            
        XYEdges edgesOne = new XYEdges(1, 1, 1, 1);
        vfm.setBorder(BorderFactory.createRoundedBorder(edgesOne));                
        Pane pane = new Pane(new LabelField("Pane 1", Field.FOCUSABLE | Field.FIELD_HCENTER), vfm);

        // Add the pane to the model
        model.addPane(pane);

        // Create a second pane
        vfm = new VerticalFieldManager();
        for(int i = 0; i < 30; i++)
        {
            vfm.add(new LabelField("Data " + i, Field.FOCUSABLE));
        }
        LabelField iconTextLabelField = new LabelField("Pane 2");            
        model.addPane(new Pane(iconTextLabelField, vfm));

        // Create a third pane            
        vfm = new VerticalFieldManager();
        ButtonField button = new ButtonField("Button", ButtonField.CONSUME_CLICK | ButtonField.NEVER_DIRTY);
        button.setChangeListener( new FieldChangeListener()
        {
            public void fieldChanged(Field field, int context)
            {
                Dialog.inform("Button activated.");
            }
        });
        vfm.add(button);
        model.addPane(new Pane(new LabelField("Pane 3"), vfm));

        // Choose which pane the model is displaying
        model.setCurrentlySelectedIndex(1);                    

        // Create the header and initialize the model and visual properties
        TitleView header = null;
        PaneManagerController controller = null;                       
        if(headerType == OptionDialog.SCROLL_HEADER_TYPE)
        {
            header = new HorizontalScrollableTitleView(Field.FOCUSABLE);
            controller = new HorizontalScrollableController();
        }
        else if(headerType == OptionDialog.TAB_HEADER_TYPE)
        {
            header = new HorizontalTabTitleView(Field.FOCUSABLE);                
            ((HorizontalTabTitleView)header).setNumberOfDisplayedTabs(model.numberOfPanes());
            controller = new HorizontalTabController();
        }
        else
        {
            throw new IllegalStateException("Header type is not valid.");
        }

        header.setModel(model);
        XYEdges edgesFour = new XYEdges(4, 4, 4, 4);
        header.setBorder(BorderFactory.createRoundedBorder(edgesFour));

        // Set arrow images
        Bitmap leftArrow  = Bitmap.getBitmapResource("leftArrow.png");
        Bitmap rightArrow = Bitmap.getBitmapResource("rightArrow.png");            
        if(leftArrow != null)
        {
            header.setLeftArrow(leftArrow);
        }
        if(rightArrow != null)
        {
            header.setRightArrow(rightArrow);
        }           

        // Create the PaneView object, which will display the panes and is
        // controlled by the model.
        PaneView paneView = new PaneView(Field.FOCUSABLE);            
        paneView.setBorder(BorderFactory.createSimpleBorder(edgesOne));
        paneView.setModel(model);

        // Initialize the PaneManagerView
        PaneManagerView view = new PaneManagerView(Field.FOCUSABLE, header, paneView);
        view.setModel(model);            
        view.setBorder(BorderFactory.createRoundedBorder(edgesFour));
        model.setView(view);

        // Initialize the Controller
        controller.setModel(model);
        controller.setView(view);
        model.setController(controller);
        view.setController(controller);

        add(view);
    }
}  
}
  • 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-31T04:12:38+00:00Added an answer on May 31, 2026 at 4:12 am

    If you want to hide context menu (popup menu) just write this code

    protected boolean navigationClick(int status, int time) 
        {
            return true;
        }
    

    This is totally works good for me .

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

Sidebar

Related Questions

I have this code: <script> $(function() { $(#tabs).tabs({ event: mouseover }); $(#tabs).tabs(add,#tab-4,Friends Discussions); $(#tabs).tabs(add,#tab-5,Announcements);
I got a request from my friend to write a php booking system module
friends, i have created custom title bar using following titlebar.xml file with code <?xml
Friends, I know how to deploy and retrieve a single element in LINQ, but
I've got this code in my socket class: bool GSocket::Listen(int Port) { d->Socket =
I have started learning Twitter4j API and have got all credentials and tokens from
This is related to another StackOverflow question from a year ago. But, a bit
I got this script off 9lessons.info and it is supposed to auto suggest friends
How are you all my friends, after a very hard time I got this
I've got several side projects that are either still in dev or live for

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.