tags:

views:

32

answers:

1

How do I get the height of a GWT object in pixels? I am trying to find a getHeight method or something similar..

+4  A: 

You are probably looking for getOffsetHeight() (inherited by every part of the UI from UiObject):

Gets the object's offset height in pixels. This is the total height of the object, including decorations such as border, margin, and padding.

There's also the getClientHeight() from Element:

Returns the inner height of an element in pixels, including padding but not the horizontal scrollbar height, border, or margin.

You can access the underlying Element of every UiObject (meaning Widgets, etc) via the getElement() method.

Igor Klimer