I know, that it is a stuped question. but I can’t understand, what is the difference between getHeight() and getPreferredHeight() ?
When I must to use getHeight and when getPreferredHeight ?
🙁
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Surely
getHeightwill get the actual current height andgetPreferredHeightwill get the preferred height, no? 🙂Actually, on further investigation, it appears
getPreferredHeightis used by a layout manager so you can tell it what height you want your control to be.The
getHeightcall returns the actual height which, presumably, can change if need be.