You should read the documentation (or at least the JavaDoc): "public void add(Widget w): Adds a widget to a pane in the HorizontalSplitPanel. The method will first attempt to add the widget to the left pane. If a widget is already in that position, it will attempt to add the widget to the right pane. If a widget is already in that position, an exception will be thrown, as a HorizontalSplitPanel can contain at most two widgets."
I guess on you second attempt at clicking then you are trying to "add" a third widget, hence the exception. Try setLeftWidget(Widget w) or setRightWidget(Widget w) instead. //Adam Syed Shahul skrev: > Hi all. > iam using hozirantal splitter to display the widgets. > to display widgets on right pane i use link. i works fine but when i > click the link twice i cause the following error: > kindly help me regards > Thanking you in anticipation > Syed Shahul > > [ERROR] Uncaught exception escaped > java.lang.IllegalStateException: A Splitter can only contain two > Widgets. > at > com.google.gwt.user.client.ui.HorizontalSplitPanel.add(HorizontalSplitPanel.java: > 404) > at com.quads.lms.stack.client.stackPane$2.onClick(stackPane.java:306) > at > com.google.gwt.user.client.ui.ClickListenerCollection.fireClick(ClickListenerCollection.java: > 34) > at com.google.gwt.user.client.ui.Label.onBrowserEvent(Label.java:158) > at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1308) > at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java: > 1287) > at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1255) > at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java: > 103) > at > com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod(IDispatchImpl.java: > 126) > at > com.google.gwt.dev.shell.ie.IDispatchProxy.invoke(IDispatchProxy.java: > 155) > at > com.google.gwt.dev.shell.ie.IDispatchImpl.Invoke(IDispatchImpl.java: > 294) > at > com.google.gwt.dev.shell.ie.IDispatchImpl.method6(IDispatchImpl.java: > 194) > at > org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java: > 117) > at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
