我创建了一个简单的mgwt项目。
它运行良好,但动画不起作用。
我不能进口
import com.googlecode.mgwt.mvp.client.Animation;正如教程中提到的..。
上面写着
"Animation cannot be resolved"我使用的是mgwt 2.0.0 GWT 2.6.0
在我的gwt.xml类中添加了这个
<inherits name='com.googlecode.mgwt.MGWT'/>这是我的代码:
import com.google.gwt.user.client.ui.VerticalPanel;
import com.googlecode.mgwt.mvp.client.Animation; // this import not resolved
import com.googlecode.mgwt.ui.client.MGWT;
import com.googlecode.mgwt.ui.client.MGWTSettings;
import com.googlecode.mgwt.ui.client.animation.AnimationHelper;
import com.googlecode.mgwt.ui.client.widget.panel.Panel;
public class FirstPage extends VerticalPanel {
public FirstPage(){
Panel panel = new Panel();
panel.add(new Label("Intravue Dashboard"));
final ListBox list = new ListBox();
list.addItem("name1");
list.addItem("name2");
list.addItem("name3");
panel.add(list);
add(panel);
list.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
RootPanel.get().clear();
String name = list.getItemText(list.getSelectedIndex());
RootPanel.get().add(new SelectedPanel(name));
}
});
MGWT.applySettings(MGWTSettings.getAppSetting());
AnimationHelper animationHelper = new AnimationHelper();
add(animationHelper);
Panel p = new Panel();
animationHelper.goTo(p, Animation.SLIDE); // This Animation not getting imported
}发布于 2014-11-18 18:24:49
使用:
import com.googlecode.mgwt.ui.client.widget.animation.Animation;
import com.googlecode.mgwt.ui.client.widget.animation.Animations;更新:
正如JPelletier正确指出的那样,Animation.SLIDE应该是Animations.SLIDE --这个类被重命名了。动画是所有动画实现的界面。
https://stackoverflow.com/questions/27000160
复制相似问题