04-16-2009 12:35 AM
Hi friends,
I want show something like this:
image
radio_button 1
radio_button 2. edit_text
I need the to write an app which should have the above requirement. All the three should be in vertical,
and radio_button 2 and edit_text should be in horizontal.
Can any one please tell me how to do it.
Thanks,
Manoj.
04-16-2009 12:37 AM
Have a look at VerticalFieldManager and HorizontalFieldManager...
Thanks!
04-16-2009 12:42 AM
hi,
actually I am beginner.
can you please post a piece of code, it will be a great help for me.
Thanks,
Manoj.
04-16-2009 12:54 AM - edited 04-16-2009 01:10 AM
OK that you are a beginner.. I can post code, but what will you gain through it? Don't you want to know things?
Please go thru this post - http://supportforums.blackberry.com/rim/board/mess
However this is the code, take it if you don't want to learn..
MainScreen ms = new MainScreen();
HorizontalFieldManager hfm = new HorizontalFieldManager();
VerticalFieldManager vfm = new VerticalFieldManager();
// I assume that bmp,r1,r2 and ed1 are initialised .. (r1 and r2 are radio buttons, ed1 is the edit field, bmp is the image)
vfm.add(bmp);
vfm.add(r1);
hfm.add(r2);
hfm.add(ed1);
vfm.add(hfm);
ms.add(vfm);
Thanks!
Edit: Code Formatting
04-16-2009 01:02 AM
Hi,
For image use this
Bitmap objBitmap = Bitmap.getBitmapasResource(<your image>); Bitmap objBitmapField = new Bitmap(objBitmap , BitmapField.Field_USE_ALL_WIDTH);
HorizontalFieldManager row1Manager = new HorizontalFieldManager();
row1Manager.add(objBitmapField);
RadioButtonGroup objExtraSauce=null
RadioButtonField objLeftExt = null,
HorizontalFieldManager row2Manager = new HorizontalFieldManager();
objExtraSauce = new RadioButtonGroup();
objLeftExt = new RadioButtonField(" ",objExtraSauce,false,RadioButtonField.USE_ALL_WIDTH);
objExtraSauce.setChangeListener(this);
row2Manager.add(objLeftExt);
//------------------------------------------------
For RadioButton and editField in one line use this
set style of Radiobutton as mention below and add edit field after it and put both of them in one seprate horizontal manager
RadioButtonField.NO_USE_ALL_WIDTH
put all 3 horizontal managers in one verticalfield manager.
04-16-2009 01:04 AM
Hi,
thanks for your reply, The thing is that I have made the code as you written. But I got the only white screen.
Thats why I asked you to help me.
Still the problem persists. What should I do.
Thanks,
Manoj
04-16-2009 01:08 AM
Had you added those Managers to your screen?
Cheers..