quarks
quarks

Reputation: 35282

How to check if a GWT Panel is empty?

How to check if a GWT Panel (VerticalPanel, HorizontalPanel, etc.) is empty?

I used this code:

if (contactListPanel.getWidget(0) == null) { 
 // stuff
}

However, it throws an exception:

java.lang.reflect.InvocationTargetException
....
Caused by: java.lang.IndexOutOfBoundsException

Upvotes: 1

Views: 813

Answers (1)

Brian Roach
Brian Roach

Reputation: 76908

Erm ... getWidgetCount() would seem to be what you're looking for.

Upvotes: 1

Related Questions