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
Trusted Contributor
Posts: 108
Registered: ‎09-03-2010
My Device: Not Specified
My Carrier: Developer

Is there any way to move the button to some 'x' distance

Hi

 

ButtonField sendButton = new ButtonField("Login",  ButtonField.CONSUME_CLICK) {

                public int getPreferredWidth()
                {
                    int fieldWidth = 250;
                    return fieldWidth;
                }

                public int getPreferredHeight()
                {
                    int fieldHeight = 12; // required height
                    return fieldHeight;
                }
            };

 

It works fine, it displays the button in extreme left but i want to move the button into some x distance(not in the centre also)??

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

Re: Is there any way to move the button to some 'x' distance

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800508/...

----------------------------------------------------------
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: 374
Registered: ‎04-07-2010
My Device: Bold 9000
My Carrier: Airtel

Re: Is there any way to move the button to some 'x' distance

[ Edited ]

sendButton.setMargin(int a,int b,int c,int d);

 

d value is what you have to set...

Press the Like button (Thumb up) on the left side to thank and
please mark the Thread as solved if its solved...
K.S