Welcome!

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

Reply
Developer
Posts: 445
Registered: ‎07-15-2008
My Device: Not Specified
Accepted Solution

Menu-Question

Hello,

what I create a Menu like this:

 

private MenuItem testMenu = new MenuItem("..my Menu", 110, 11000) { public void run() { Dialog.alert("Test"); } };

 

and then add it to my screen like this:

 

 

addMenuItem(testMenu);

then how do I create a Menu Separator? Can't I just use this:

 

addMenuItem(new SeparatorMenu());

?

 

Thank you,

javeC

 

 

 

 

 

 

 

 

If your question was answered, please accept it as a sollution and / or give Kudos ;-)
______________________________
Use the Search Field first! Maybe the question you want to ask already exists!
Highlighted
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Menu-Question

Suggest you review this Thread, especially the last post from simon_hain.

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=11889

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Menu-Question

class MenuItem
static MenuItem separator(int ordinal)
Adds a separator at the specified position (ordinal).

or
class Menu
int addSeparator()
Adds separator item to this menu.

also note that your Dialog will cause your application to explode (at least!) as it is not called from the event thread. you should know what to do Smiley Happy
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Menu-Question

right, visit "my" link, peter has a fast day!
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Menu-Question

Quick clarification please Simon, won't the menu item be invoked with the Event Thread, so the Dialog is OK?

 

Re the fast day - I wish.......

Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Menu-Question

yep, you are right. now: weekend Smiley Happy
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
BlackBerry Development Advisor
Posts: 15,882
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell