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

Posts: 32
Registered: ‎03-11-2014
My Device: 8520
My Carrier: 8520
Accepted Solution

Arranging Button Help

Hy everyone, I am trying to create a Blackberry app and i created a LabelField with some text, and i want to make a button in the same line with the text, but i don't know how to do that.

Here is the code:

public StakeMenu(){
        LabelField stake = new LabelField("Chicken stake", Field.FIELD_LEFT);
        HorizontalFieldManager buttonManager = new HorizontalFieldManager(Field.VISUAL_STATE_ACTIVE);
        ButtonField add = new ButtonField("Add", ButtonField.CONSUME_CLICK);

Unfortunetly my code puts the button under the text, but i want to be in the same line with it. Please help me !

Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Arranging Button Help

[ Edited ]

I suspect from your code that you don't really understand BlackBerry Ui - which is not surprising given that you are new to the platform.  So I suggest some background reading on UI and Fields.  The Java micro-site contains information that will be useful, for example this:



I suggest you work through the entire site - not leanring everything but finding out where useful documentation is:




Once you have done that, I suspect you will then fall into the trap that other have fallen into when putting labels and Buttons side by side.  So if you do have problems with this, then use the Search Field (see top right) to find the questoins that others have asked and resolved.