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
Developer
Posts: 42
Registered: ‎04-01-2009
My Device: Not Specified

Re: Positioning Labels and Images

Almost but not quite working still..... one part that I left out in the code that I described is that

add(bitField);

 

should be:

FlowFieldManager Btn = new FlowFieldManager(USE_ALL_WIDTH);

Btn.add(bitField);

...

this.add(Btn);

 

then when I try using Btn.add(manager1) it screws up with all the layout but I do see the label.

Developer
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified

Re: Positioning Labels and Images

Rather than adding manager1 into Btn add this into mainscreen.

 

this.add(manager1);

 

Regards

Bikas

 

Developer
Developer
Posts: 42
Registered: ‎04-01-2009
My Device: Not Specified

Re: Positioning Labels and Images

Still doesn't seem to work correctly. My whole UI is all made of bitmapfields so after the button load there are other bitmapfields to load under it. When it do the this.add(manager1) it will not display all the graphics underneath. I'm also trying to load the label onto of another bitmapfield that is underneath the image button. Is there a way to do it without effecting the fields underneath?
Developer
Posts: 984
Registered: ‎02-10-2009
My Device: Not Specified

Re: Positioning Labels and Images

post the code snippet that you trying.

 

And it would be better if can clear your requirement I mean exactly what you want to display in the screen.

 

Regards

Bikas

 

Highlighted
Developer
Developer
Posts: 42
Registered: ‎04-01-2009
My Device: Not Specified

Re: Positioning Labels and Images

Using the Layout manager from before.

 

Here is part of the main program.

 

FlowFieldManager quickButtonTop = new FlowFieldManager(USE_ALL_WIDTH);

final LabelField x = new LabelField("This field works!");
        final LayoutManager manager1 = new LayoutManager();

 

//Button 1 with the click and display label
        BitmapField bitField1= new BitmapField(img1,BitmapField.FOCUSABLE){
        public boolean trackwheelClick(int status, int time){
            if (status1){
                setBitmap(img1);
                status1= false;           
            } else{
                setBitmap(img1a); //changes the image
                status1= true;
                manager1.deleteAll();
                manager1.add(x);
            }
            return true;
            }
        };
        quickButtonTop.add(bitField1);  
         

//Second button on the same horizontal line as button 1    
        BitmapField bitField2= new BitmapField(img2, BitmapField.FOCUSABLE){
        public boolean trackwheelClick(int status, int time){
            if (status2){
                setBitmap(img2);
                status2= false;           
            } else{
                setBitmap(img2a);
                status2= true;
            }
            return true;
            }
        };
        quickButtonTop.add(bitField2);
        this.add(quickButtonTop);
        this.add(manager1);
        }
       
        //Status Area: label to be display on top of this image       
        BitmapField bitField_statusArea = new BitmapField(img_statusArea, BitmapField.FOCUSABLE);
        add(bitField_statusArea);

 

.................//Two more quick buttons underneath