首页 > 代码库 > JAVA中引用com.sun.awt.AWTUtilities时报错
JAVA中引用com.sun.awt.AWTUtilities时报错
JAVA中引用com.sun.awt.AWTUtilities时报错的解决办法[转]
在Eclipse中设置如下就可以了:
When using com.sun.awt.AWTUtilities, Eclipse gives a error:
- Access restriction: The method setWindowOpacity(Window, float) from the type AWTUtilities is not accessible due to restriction on requiredlibrary C:\Program Files\Java\jre6\lib\rt.jar
- Access restriction: The type AWTUtilities is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar
You can fix it like this:
Preferences -> Java -> Compiler -> Errors/Warnings -> Deprecated and restricted API ->
Forbidden reference -> change "error" to "warning"
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。