请有人帮助我解决此错误
Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problems:
schemes cannot be resolved to a variable
schemes cannot be resolved
schemes cannot be resolved
schemes cannot be resolved to a variable
at org.jvnet.substance.utils.SubstanceColorSchemeUtilities.getColorSchemes(SubstanceColorSchemeUtilities.java:615)
at org.jvnet.substance.api.SubstanceSkin.getColorSchemes(SubstanceSkin.java:635)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at javax.swing.UIManager.setLookAndFeel(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
答案 0 :(得分:3)
线程中的异常“AWT-EventQueue-0”java.lang.Error:未解决的编译问题:方案无法解析为变量方案无法解析方案无法解析方案无法解析为变量
这表明基本上你甚至不应该尝试运行代码 - 它不会编译。如果您正在使用Eclipse,那么在尝试运行代码时应该会收到一个警告对话框,说明它没有干净地编译 - 此时正确的做法是总是不运行它。如果您使用的是其他IDE,则可能没有弹出对话框,但您仍然可以在任何错误列表视图中看到错误。
在getColorSchemes
方法中,您尝试引用名为schemes
的变量,该变量显然尚未在任何地方声明。我们不能在没有看到代码的情况下说出更多内容,但它可能就像有一个名为colorSchemes
的变量而不是schemes
或类似的变量一样简单。