Vaadin有一个名为WebBrowser的类,它提供有关客户端(浏览器)的有用信息:
您可以访问当前的WebBrowser实例,例如,如下所示:
public class MyApplication extends Application {
@Override
public void init() {
setMainWindow(new Window());
ApplicationContext context = this.getContext();
if (context instanceof WebApplicationContext) {
WebBrowser webBrowser = ((WebApplicationContext) this.getContext()).getBrowser();
Date now = webBrowser.getCurrentDate(); // Returns the current date and time on the browser
}
}
}
Run Code Online (Sandbox Code Playgroud)
有关WebBrowser类的更多信息,请参阅其JavaDocs.
| 归档时间: |
|
| 查看次数: |
2225 次 |
| 最近记录: |