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"

JAVA中引用com.sun.awt.AWTUtilities时报错,布布扣,bubuko.com

JAVA中引用com.sun.awt.AWTUtilities时报错

上一篇:java阻塞主线程的实现


下一篇:java.io.ByteArrayOutputStream 源码分析