Java Page.getCurrent()所需的vaadin导入
我想知道在vaadin框架中,Java Page.getCurrent()所需的vaadin导入,java,import,vaadin,Java,Import,Vaadin,我想知道在vaadin框架中,Page.getCurrent()需要导入什么,google搜索会让我找到com.vaadin.server包,但eclipse通知我,import com.vaadin.server无法解析,还尝试了com.vaadin.server.和import com.vaadin.server.Page但无法解决该问题。我用的是瓦丁6.8 这是我要上的课 package com.example.juju; import com.vaadin.Application; i
Page.getCurrent()
需要导入什么,google搜索会让我找到com.vaadin.server
包,但eclipse通知我,import com.vaadin.server
无法解析,还尝试了com.vaadin.server.
和import com.vaadin.server.Page代码>但无法解决该问题。我用的是瓦丁6.8
这是我要上的课
package com.example.juju;
import com.vaadin.Application;
import com.vaadin.ui.Label;
import com.vaadin.ui.Window;
import com.vaadin.ui.Window.Notification;
public class JujuApplication extends Application
{
@Override
public void init() {
Window mainWindow = new Window("Myproject");
// Notification with default settings for a warning
Notification notif = new Notification("Warning",
"<br/>Area of reindeer husbandry",
Notification.TYPE_WARNING_MESSAGE);
// Customize it
notif.setDelayMsec(20000);
notif.setPosition(Notification.POSITION_BOTTOM_RIGHT);
notif.setStyleName("mystyle");
// Show it in the page
notif.show(Page.getCurrent());
setMainWindow(mainWindow);
}
}
package com.example.jujuju;
导入com.vaadin.Application;
导入com.vaadin.ui.Label;
导入com.vaadin.ui.Window;
导入com.vaadin.ui.Window.Notification;
公共类JujuApplication扩展了应用程序
{
@凌驾
公共void init(){
窗口主窗口=新窗口(“Myproject”);
//带有警告默认设置的通知
Notification notif=新通知(“警告”,
“
驯鹿饲养区”,
通知。键入警告消息);
//定制它
notif.setDelayMsec(20000);
notif.setPosition(通知.POSITION\u底部\u右侧);
notif.setStyleName(“mystyle”);
//在页面中显示它
notif.show(Page.getCurrent());
设置主窗口(主窗口);
}
}
提前谢谢
Page.getCurrent()
根据vaadin论坛的说法,vaadin 7是一个受支持的版本,而不是vaadin 6.x我使用的是vaadin书中提供的《新手分步指南》,而不是maven。感谢书中提到的Page.getCurrent()
方法是哪一部分?您最后的评论给了我一个提示,这可能是一个兼容性问题,Page.getCurrent()在vaadin 7书中提到过,我想我在读vaading 6书,但是我的系统上安装了vaading 6,但仍然不确定这是否与版本兼容性有关。总之,这里提到了Page.getCurrent()