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
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Need an idea on layout method

[ Edited ]

I want to know what method sublayout and extent ,that i used in it,besides i want to know abt layout method also

public void paint(Graphics g)
{

g.setColor(Color.BLUE);
g.fillRect(10, 10,70,120);

}

protected void layout(int arg0, int arg1) {
//this.setExtent(Display.getWidth()/2,Display.getHeight()/3);
this.setExtent(Display.getWidth()/2,Display.getHeight());


}

 

 

Will running this is i get,rect in center ,i want to know why?i want it in corner

 

image link is here

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Need an idea on layout method

where do you use it?

----------------------------------------------------------
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.
@SimonHain on twitter
Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Need an idea on layout method

I want to draw a graph,so i need a work area for the graph to be drawn,besides i'm not clear with the method setextent and layout,it would be helpful,if i get an idea on this

Contributor
Posts: 17
Registered: ‎02-25-2010
My Device: Bold 9700 OS 5.0.0.593
My Carrier: Vodafone Spain

Re: Need an idea on layout method

Sorry for my Englhis, i'm spanish

 

The Layout is the part of any object seen on the screen,  each label, each editfield has a layout that is what we see on the screen, everything is painted outside the layout is invisible.

With setextent what we are doing is to set a maximum size for that layout, and finally it defines the size for the object.

----------------------------------------------
caelul // Spanish Developer
-------------------------------------------