Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Developer
Posts: 6
Registered: ‎08-04-2008
My Device: Not Specified

DefaultMenuListField info needed. Mixing javax & net.rim

I'm trying to capture the Selected Index of a menu from a J2EE MIDlet. I'm using TrackwheelListener. The menu appears in a class that extends Form. When I use the following RIM classes from within the MIDlet this is what's returned:

UiApplication uia = UiApplication.getUiApplication();
Screen scre = uia.getActiveScreen();
Field field = scre.getFieldWithFocus();

Variable scre is type:

Variable field is type: net.rim.device.api.ui.menu.DefaultMenuListField


Variable field has all the goodies that I need to access. field._items is an array of MenuItems, and field._selection has the selected index.....

Has anyone had any success capturing the MenuItem from within a MIDlet. I know about the depreciated API but the alternative is very inconsistant and limited trackball useage.

BlackBerry Development Advisor
Posts: 15,876
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: DefaultMenuListField info needed. Mixing javax & net.rim

[ Edited ]

The intermixing of GUI elements of BlackBerry CLDC applications and MIDlets is not supported.  Other APIs can be intermixed.


You can add custom items to the menu of a MIDlet by adding commands.  There is no method that directly returns the currently selected menu item.



What action are you trying to accomplish by getting the selected menu item?

Message Edited by MSohm on 08-07-2008 01:07 PM
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.