0

看这个代码;

SplitLayoutPanel splitLayoutPanel=new SplitLayoutPanel();
splitLayoutPanel.addWest(new Label("west"), 200);
splitLayoutPanel.add(new Label("center"));

然后

Label myWestLb= (Label)splitLayoutPanel.getWidget(0); //this code is ok, no problem

Label myCentralLb= (Label)splitLayoutPanel.getWidget(1); //this code got error

有谁知道如何获取添加到 SplitLayoutPanel 中心的 Widget?

4

1 回答 1

1

有一种方法。它被称为 getCenter() :)。

http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/ui/DockLayoutPanel.html#getCenter%28%29

于 2013-10-10T08:12:52.923 回答