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
manukumar
Posts: 57
Registered: ‎04-14-2009
My Device: Not Specified

How to solve this

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. 

Developer
mantaker
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: How to solve this

Have a look at VerticalFieldManager and HorizontalFieldManager...

 

Thanks! 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
manukumar
Posts: 57
Registered: ‎04-14-2009
My Device: Not Specified

Re: How to solve this

hi,

 

actually I am beginner. 

 

can you please post a piece of code, it will be a great help for me.

 

Thanks,

Manoj. 

Developer
mantaker
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: How to solve this

[ Edited ]

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/message?board.id=java_dev&message.id=13264#M13264

 

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

Message Edited by mantaker on 04-16-2009 10:40 AM
--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group
Developer
Rajat_10Sep
Posts: 696
Registered: ‎12-02-2008
My Device: Not Specified

Re: How to solve this

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.

 

 

 

Regards,
Rajat Gupta.
--------------------------------------------------------------------------------
If your problem was get solved then please mark the thread as "Accepted solution" and kudos - your wish
Developer
manukumar
Posts: 57
Registered: ‎04-14-2009
My Device: Not Specified

Re: How to solve this

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 

Developer
mantaker
Posts: 1,477
Registered: ‎12-30-2008
My Device: Torch 9810

Re: How to solve this

Had you added those Managers to your screen?

 

Cheers.. 

--
Manimaran Selvan
Co-Founder, Tech Lead,
Equity Markets Research Group