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
Contributor
Posts: 20
Registered: ‎01-21-2011
My Device: Simulator 9000
My Carrier: dev
Accepted Solution

how to set the Size of HTMLBrowserField

Hi all,

 

I am developing an application like Browser. I get the browser content with:

 

 

browserContent = _renderingSession.getBrowserContent(connection, this, e);

 

and then passing to a filed with:

 

Field field = browserContent.getDisplayableContent();

 

Then I display that field on the screen. The problem is that It is displayed as full screen. I want to be able to change the x,y position,width and height values.

 

How can I do it? Any idea may be helpful.

 

Thanks and regards.

Contributor
Posts: 20
Registered: ‎01-21-2011
My Device: Simulator 9000
My Carrier: dev

Re: how to set the Size of HTMLBrowserField

I used my own manager class that extended from vertical field manager and in the sublayout function, I set the coordinates:

 

 

public class BrowserFieldContainer extends VerticalFieldManager {
public int[][] coords = null;
public BrowserFieldContainer() {
//	 super( Manager.NO_VERTICAL_SCROLL );
super();
}

public void sublayout(int maxWidth, int maxHeight) {
      
super.setPosition(0, 0);
super.sublayout(maxWidth, maxHeight); //bu kalkarsa x=0, y=0 oluyor.
super.setExtent(maxWidth,maxHeight);
Field field = getField(0); //get the field
setPositionChild(field,x,y); //set the position(x,y) for the field
layoutChild(field, w, h); //determines w and h of the field
}
}

 It works now. No problem at displaying one HTMLBrowserField.

 

Now I want to insert multiple fields with different url's. But It displays only one. I asked it also at

http://supportforums.blackberry.com/t5/Java-Development/multiple-browsers-can-t-display-at-different...

 

If you have any idea. I will appreciate.

 

Thanks and regards.