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
New Developer
Posts: 16
Registered: ‎12-22-2009
My Device: 8900
My Carrier: VodaFone India

What does getPreferredWidth() and getPreferredHeight() return??

Hi all,

 

I am not getting clear about the concept of getPreferredWidth()  and getPreferredHeight() methods. What do they return means on what what basis the values are returned.??

 

What is difference between getWidth() and getPreferredWidth()???

 

Thank you..

 

Regards,

Rammy

Developer
Posts: 222
Registered: ‎11-11-2009
My Device: Storm

Re: What does getPreferredWidth() and getPreferredHeight() return??

I think following thread will clear you

http://supportforums.blackberry.com/t5/Java-Development/Fields-not-visible/m-p/407378#M80466

with regards,
Vignesh J

-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Don't forget to mark your post as solved if you get the answer and dont forget to give kudos if the answer is useful for you.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: What does getPreferredWidth() and getPreferredHeight() return??

Just to summarise

 

getPreferred... is returned from the Fields to indicate how big they would like to be.  There should be a value fot his this regardless of thee state of the Field.  The Manager will use this to determine how much space to allocate to the Field. 

 

get... is the actual space that has been allocated by the Manager.