If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
New Developer
garimasharma
Posts: 62
Registered: ‎01-19-2010
My Device: storm
My Carrier: storm

Cod file creation issue

Hi,

 

 

I have an issue and not able to find the solution  when I write the code:

 

hfmans=new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER)
                {
                    protected void paint(Graphics graphics) {
                        // TODO Auto-generated method stub
                        Bitmap b=Bitmap.getBitmapResource("answer_view.png");
                        super.paint(graphics);
                    }
                    
                };

 

I thinks this is a right code of lines but I run this program Code file is not made.

when i put semicolon after the HorizontalFieldManage then It creates .cod file.

 

hfmans=new HorizontalFieldManager(HorizontalFieldManager.FIELD_HCENTER);
                {
                    protected void paint(Graphics graphics) {
                        // TODO Auto-generated method stub
                        Bitmap b=Bitmap.getBitmapResource("answer_view.png");
                        super.paint(graphics);
                    }
                    
                };

 

I am confused and tried a lot but didn't get any reason .

 

Please Give me solution.

 

 

Please use plain text.
Developer
Gunjan
Posts: 50
Registered: ‎09-01-2009
My Device: Not Specified

Re: Cod file creation issue

hi

 

first of al i think you have copy n pasted same code..accourding to your problem i think there should not be semicolon on first code.

 

"when i put semicolon after the HorizontalFieldManage then It creates .cod file." this is absolutely right as you are overriding paint method of your manager.

 

 

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: Cod file creation issue

Are you telling us you get a compile error with the first code and not with the second? 

 

If so, and I hate to ask the obvious, but have you checked that you have matching "}" for every "{".

 

What compile error are you getting?

Please use plain text.