开发者

getHeight() vs getPreferredHeight() what is the difference

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 ?

:(


Surely getHeight will get the actual current height and getPreferredHeight will get the preferred height, no? :-)


Actually, on further investigation, it appears getPreferredHeight is used by a layout manager so you can tell it what height you want your control to be.

The getHeight call returns the actual height which, presumably, can change if need be.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜