我正在尝试从他们的 Vaadin (LayoutExample.java) 书中重新创建一些 Vaadin 示例。我正在使用他们的最新版本 v7.但是,当尝试编译以下代码时,编译器会提示最后一行中的 addComponent
没有为 Panel
类型定义。我的问题是,Vaadin书中的例子应该用不同版本的Vaadin来编译吗?
我正在评估 Vaadin 的一个项目,但到目前为止,我在他们的网站上发现了许多示例,这些示例未使用最新的 Vaadin 库进行编译。我错过了什么吗?
HorizontalLayout horlayout = new HorizontalLayout();
Panel menuContainer = new Panel("The Possible Places");
horlayout.addComponent(menuContainer);
// A menu tree, fill it later.
Tree menu = new Tree();
menuContainer.addComponent(menu);
最佳答案
正如 the preface of the Book Of Vaadin 中所述
Writing this manual is an ongoing work and it is rarely completely up-to-date with the quick-evolving product. This version is a snapshot taken soon after the release of Vaadin 7.
While this edition is mostly updated for Vaadin 7, it may still contain some outdated content related to Vaadin 6.
当然,这并不理想;如果您可以将包含过时示例的 URL 报告给 Vaadin forum ,它可以被纠正,这将帮助其他用户。
关于java - 'Book of Vaadin' 中的 Vaadin 示例未编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15126320/