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
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: two radio buttons on a single line

The following seemed to display OK for me.  Tested in JDE 4.2.1.

 

 

Dialog d = new Dialog("Message", null, null, 0, Bitmap.getPredefinedBitmap(Bitmap.QUESTION), Dialog.GLOBAL_STATUS); HorizontalFieldManager hfm = new HorizontalFieldManager(); hfm.add(new ButtonField("B1")); hfm.add(new ButtonField("B2")); hfm.add(new ButtonField("B3")); hfm.add(new ButtonField("B4")); d.add(hfm); d.doModal();

 

Give it a try.

Developer
cjlopez
Posts: 48
Registered: ‎08-01-2008
My Device: Not Specified

Re: two radio buttons on a single line

[ Edited ]

Wow, dude, thanks a lot!!!!!!

 

Really did the work!!!!

 

Now i'm running with another issue, my last 2 button aren't being displayed, jajajajaja, the dialog is to short to show the 5 buttons, xDDDD

 

Thanks for the help

Message Edited by cjlopez on 03-19-2009 09:39 PM
Message Edited by cjlopez on 03-19-2009 09:48 PM
New Developer
guyland123
Posts: 6
Registered: ‎03-20-2009
My Device: Not Specified

Re: two radio buttons on a single line

strange i tried using the RadioButtonField.NO_USE_ALL_WIDTH, and I get an error 

"NO_USE_ALL_WIDTH cannot be resolved or is not a field"

 

I search in my help in eclipse, and I don't see NO_USE_ALL_WIDTH

If I search online, then I see it in the reference for RadioButtonField for OS Ver 6.0

 

My porject is using Blackberry JRE 6.0.0

 

What gives?

 

Any ideas?

Trusted Contributor
Himanshu_berry
Posts: 138
Registered: ‎04-19-2012
My Device: No

Re: two radio buttons on a single line

i am trying to do this but not success found to add horizontally ....only first radiobutton is visible 

plz help me 

thanks in advance.

Himanshu:Sweatdrop:

Trusted Contributor
Himanshu_berry
Posts: 138
Registered: ‎04-19-2012
My Device: No

Re: two radio buttons on a single line

can any body help me.

Developer
BrajeshSanodiya
Posts: 134
Registered: ‎08-03-2011
My Device: torch, Z10

Re: two radio buttons on a single line

try to give layout it will work...

RadioButtonGroup group = new RadioButtonGroup();

final RadioButtonField radio1 = new RadioButtonField("one", group, true);
final RadioButtonField radio2 = new RadioButtonField("two", group, false);
HorizontalFieldManager hfm = new HorizontalFieldManager(){
protected void sublayout(int maxWidth, int maxHeight) {
setPositionChild(radio1, 0, 0);
layoutChild(radio1, 100, 50);
setPositionChild(radio2, 150, 0);
layoutChild(radio2, 100, 50);
setExtent(maxWidth, maxHeight);
}
};
hfm.add(radio1);
hfm.add(radio2);
add(hfm);
-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------
Trusted Contributor
Himanshu_berry
Posts: 138
Registered: ‎04-19-2012
My Device: No

Re: two radio buttons on a single line

Thanks ya its working

but its hiding all my another fields which are just below the radiogroup means]

 

DateField , ChoiceField ,ButtonField are not showing after usinig this code.

Developer
BrajeshSanodiya
Posts: 134
Registered: ‎08-03-2011
My Device: torch, Z10

Re: two radio buttons on a single line

Hi,
Problem is in setExtent(maxWidth, maxHeight);

give some fixed height.

setExtent(maxWidth, 100);
-----------------------------------------------------------------------
"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
-----------------------------------------------------------------------