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
Trusted Contributor
Posts: 224
Registered: ‎08-09-2011
My Device: 9550
My Carrier: BBprogrammer

BrowserField SetBackground is not Working

Hi all,

 

 

       I am Working on BrowserField. And i am displaying the data on BrowserField But I got White background for BrowserField default.I want to change the Background as :

 

 

BrowserField browserField = new BrowserField();
mainManager.add(browserField);
Bitmap bitmap = Util.getFitBitmapImage("img/iner_whitebg.png",
Display.getWidth(), Display.getWidth());
browserField.setBackground(BackgroundFactory
.createBitmapBackground(bitmap,
Background.POSITION_X_INHERIT,
Background.POSITION_Y_INHERIT,
Background.REPEAT_BOTH));
browserField.displayContent("",
URL);

 

And i want to change the Font for Filed And this one also won't changed ,displaying the default font.

 

 

 

browserField.setFont(Util.getStandardFont(6));

 

 

Is it Possible for Changing the Background and Font for BrowserField.

 

    

Developer
Posts: 243
Registered: ‎07-22-2011
My Device: BlackBerry Z10
My Carrier: AirTel

Re: BrowserField SetBackground is not Working

Hi,

 

Yes you can change browserfield background and font also, try this code...

temp = "<body bgcolor = \"#F7EFD8\" style=\"width:"+(Display.getWidth()-40)+"px;\"><font size=2><p style=text-align:"+justif+"; dir="+direction+">";
browser.displayContent(temp+description);

 like this you have to give in html tags format......

 

 

Regards,

Lakshman K

----------------------------------------------------------
Feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

Trusted Contributor
Posts: 224
Registered: ‎08-09-2011
My Device: 9550
My Carrier: BBprogrammer

Re: BrowserField SetBackground is not Working

Thank You for your information