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

Regular Contributor
Posts: 77
Registered: ‎06-13-2013
My Device: 9900
My Carrier: blackberry cure

How to move drop left in blackberry + java ;

[ Edited ]

I am using ObjectChoiceField example it is showing drop down at the end of right side  need to show some margin of left side .

how we can achieve this ?



I am using this example


  String choices[] = {"Monday","Tuesday","Wednesday","Thursday","Friday", "Saturday", "Sunday"};
        int iSetTo = 0;
        VerticalFieldManager vfm=new VerticalFieldManager(){
        	protected void paint(Graphics graphics) {
        vfm.add(new ObjectChoiceField("Day of the week",choices,iSetTo){
        	protected void paint(Graphics graphics) {



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

Re: How to move drop left in blackberry + java ;

I believe you have been supplied an answer to this in your Stack Overflow post here:



I agree with the answer supplied, using setMargin is not documented until much later but works satisfactorily in my experience in all OS's after 4.5 at least. 


However in the image that I can see, you just want the drop down moved the left.  To do this I recommend you try the Field syle - Field.FIELD_LEFT.  It appears you are trying to line the Field up with other Fields, and I suspect you have a VerticalFieldManager or perhaps a GridFieldManager or TableLayoutManager to do this.  Whichever ii is, it will give the ChoiceField the full width and the ChoiceField normally decides to use the right hand portion of it.  You can instead tell the ChoiceField to use the left hand side using Field.FIELD_LEFT. 


So in your case, you would use this:


new ObjectChoiceField("Day of the week",choices,iSetTo, Field.FIELD_LEFT)