如何抑制 NetBeans 6.9.1 中的警告?
在教授 JavaFX 时,我们使用一些包含 Swing 组件的旧文件。它们在 NetBeans 6.8 中运行正常,但在 NetBeans 6.9.1 中会生成许多以下警告:
警告:[warnonuse] 包 javafx.ext.swing 已被使用。 import javafx.ext.swing.SwingToggleButton;
有什么方法可以抑制这些警告的生成吗?
On teaching JavaFX, we use some older files containing Swing components. They run OK in NetBeans 6.8, but in NetBeans 6.9.1 many following warnings are generated:
warning: [warnonuse] Package javafx.ext.swing has been used.
import javafx.ext.swing.SwingToggleButton;
Is there any way to suppress generation of these warnings?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在JavaFX SDK配置文件目录下的desktop.properties文件中,
你可以改变属性
swing_compile_opts="-XDwarnOnUse=javafx.ext"
swing_compile_opts=
在 Netbeans 下,这将位于
NETBEANS_HOME/javafx/javafx-sdk/profiles。
这仅适用于 1.3.1,并且很可能在下一个版本中会完全不同
JavaFX 的主要版本。
In the desktop.properties file under your JavaFX SDK profiles directory,
you can change the property
swing_compile_opts="-XDwarnOnUse=javafx.ext"
to
swing_compile_opts=
Under Netbeans this would be in
NETBEANS_HOME/javafx/javafx-sdk/profiles.
This only applies to 1.3.1 and most likely will be totally different in the next
major release of JavaFX.
谢谢,吉姆。这就是窍门。
对于 Mac 用户,您必须进入 /Applications/Netbeans/Netbeans 6.9.1.app 文件夹,然后修改
桌面配置文件,然后重新启动 Netbeans 后警告就会消失。
Thanks, Jim. That does the trick.
For Mac users, you have to go into your /Applications/Netbeans/Netbeans 6.9.1.app folder, then down to
I modified the desktop profile and after restarting Netbeans the warnings went away.