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: 39
Registered: ‎04-01-2008
My Device: Not Specified

How to layout RadioButtonFields horizontally?

Does anyone know how to do this?
Highlighted
Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: How to layout RadioButtonFields horizontally?

Developer
Posts: 39
Registered: ‎04-01-2008
My Device: Not Specified

Re: How to layout RadioButtonFields horizontally?

I suppose you didn't try this before because it does not work.  

 

If it would be that easy I wouldn't ask. Any other thoughts?

 

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: How to layout RadioButtonFields horizontally?

[ Edited ]

My apologies. Use RadioButtonField.NO_USE_ALL_WIDTH.

 

HorizontalFieldManager horizontalFieldManager = new HorizontalFieldManager();

 

RadioButtonGroup radioButtonGroup = new RadioButtonGroup();

 

RadioButtonField radioButtonField1 = new RadioButtonField( "test1", radioButtonGroup, false, RadioButtonField.NO_USE_ALL_WIDTH );
RadioButtonField radioButtonField2 = new RadioButtonField( "test2", radioButtonGroup, true, RadioButtonField.NO_USE_ALL_WIDTH );
RadioButtonField radioButtonField3 = new RadioButtonField( "test3", radioButtonGroup, false, RadioButtonField.NO_USE_ALL_WIDTH );


horizontalFieldManager.add( radioButtonField1 );
horizontalFieldManager.add( radioButtonField2 );
horizontalFieldManager.add( radioButtonField3 );


add( horizontalFieldManager );

 

Although it seems to be undocumented, so maybe try sticking the fields into seperate vertical field managers (inside a horizontal field manager).
Message Edited by mreed on 07-22-2008 08:12 PM