Reputation: 76
I have a Label with very-very long string in it.
Method label.getOffsetWidth()
returns 0 (I dont know why). But String
is displayed.
How can i get Label (or String) width in pixels using GWT 2.4.0
?
Upvotes: 3
Views: 6726
Reputation: 76
Ok. I found answer for my question.
For be sure that Label have rendered use Scheduler.get().scheduleDeferred(Scheduler.ScheduledCommand cmd)
In @Override execute()
call label.getElement().getClientWidth();
And that's it.
Upvotes: 2