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
Highlighted
Developer
Posts: 191
Registered: ‎04-02-2013
My Device: BlackBerry Bold 9900
My Carrier: developer
Accepted Solution

Problem in GUI

Hi

I want to create a GUI like this:

Border image - constant

Response from the server - verticalScrollable

Horizontal Bar - constant.

 

In mainScreen constructor , i have added the topbar first

{

topbar 

try

{

//response from server

showData();--- it will display the response in the scrollbale field And it will repeat 3-4 times

}

}

showData()

{}

 

Now, where do i put the bottombar code?

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Problem in GUI

I don't understand your question, but I suspect that reviewing this will help you:

http://supportforums.blackberry.com/t5/Java-Development/MainScreen-explained/ta-p/606644

Developer
Posts: 191
Registered: ‎04-02-2013
My Device: BlackBerry Bold 9900
My Carrier: developer

Re: Problem in GUI

See i want to create a GUI in which i have a top image and bottom image and its constant and in middle i am getting the dynamic data form the server.

 

so in my mainscreen constuctor. I have added the topimage

constructor()

{

1)topimage.

2) response from server by creating the http connection and displaying the response through a method say displayResponse(). 

SO when i get the response i simply call this function and the response gets displayed..

Now i want to know where do i add the bottom image.

}

 

The view is like this.

 

HorizontalTopImage

Horizontalscrollbale data..... I can only scroll this the other two images remain the same..

HorizontalBottomImage

Problem in placing the bottom image.

 

 

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Problem in GUI

It seems to me MainScreen provides this functionality with no effort if you use the Banner or Title area for your top image and the status area for your bottom image, as explained at the start of the KB article I referred you too.

 

If this does not work for you, can you explain what is failing in this approach. 

Regular Contributor
Posts: 66
Registered: ‎08-28-2010
My Device: 9630

Re: Problem in GUI

Hello,

 

its easy to make constant image and make dynamic middle of content.

 

You take one Main VerticalFieldManager as below.

 

VerticalFieldManager MainBGContainer = new VerticalFieldManager(VerticalFieldManager.USE_ALL_WIDTH | VerticalFieldManager.USE_ALL_HEIGHT | NON_FOCUSABLE)
{
public void paint(Graphics g) {
g.clear();
g.drawBitmap(0, 0, Display.getWidth(), Display.getHeight(),_backgroundBitmap, 0, 0);
super.paint(g);
}
};

 

Then take one HorizontalManager and add it to MainBGContainer. as below. 

 

hfmTopbar = new HorizontalFieldManager(HorizontalFieldManager.USE_ALL_WIDTH)
{
public void paint(Graphics g) {
g.clear();
g.drawBitmap(0, 0, g.getScreenWidth(), g.getScreenHeight(),setTopBar, 0, 0);
super.paint(g);
}
};
MainBGContainer.add(vfmTopbar);

 

In hfmTopbar add your content using the verious layout and make static topbar.

 

Same Process for the bottombar and add the bottom bard to MainBGContainer.

 

Now In middle of container add your dynamice content.

 

Regards,

Developer
Posts: 191
Registered: ‎04-02-2013
My Device: BlackBerry Bold 9900
My Carrier: developer

Re: Problem in GUI

Thanks Peter and rakeshmijyani