此代码有错误
@Override
public void onClick(ClickEvent event) {
// TODO Auto-generated method stub
mainDockPanel.remove(panel1);
mainDockPanel.remove(panel2);
if(mainDockPanel.getWidgetDirection(panel1).equals(DockPanel.EAST)){
mainDockPanel.add(panel1, DockPanel.WEST);
mainDockPanel.add(panel2, DockPanel.EAST);
}
else if (mainDockPanel.getWidgetDirection(panel1).equals(DockPanel.WEST)){
mainDockPanel.add(panel1, DockPanel.EAST);
mainDockPanel.add(panel2, DockPanel.WEST);
}
}
这段代码有问题吗?
另外,还有其他更好的解决方案来交换 2 个面板吗?