Page.getCurrent()所需的vaadin导入

时间:2012-11-11 22:47:13

标签: java import vaadin

我想知道vaadin框架中Page.getCurrent()所需的导入是什么,谷歌搜索引导我到com.vaadin.server包,但是eclipse通知我import com.vaadin.server无法解决,已尝试com.vaadin.server.*import com.vaadin.server.Page;,但无法解决此问题。我正在使用vaadin 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);
    }
}

提前致谢

1 个答案:

答案 0 :(得分:2)

Page.getCurrent()

是根据vaadin论坛支持vaadin 7而不是vaadin 6.x