我想在我的摇摆应用中使用一些第三方主题(例如synthetica http://www.javasoft.de/synthetica/themes/)。我正在使用eclipse ide
,获取了主题的jar文件并在我的代码中进行了以下修改(根据主题的自述文件)
try
{
UIManager.setLookAndFeel(new SyntheticaBlackMoonLookAndFeel());
}
catch (Exception e)
{
e.printStackTrace();
}
但在此修改后,它显示以下错误
The type de.javasoft.plaf.synthetica.SyntheticaLookAndFeel cannot be resolved. It is indirectly referenced from required .class files
这是什么意思?我尝试在网上搜索,但无法找到任何有用的答案
自述文件的内容:
System Requirements
===================
Java SE 5 (JRE 1.5.0) or above
Synthetica V2.2.0 or above
Integration
===========
1. Ensure that your classpath contains all Synthetica libraries (including
Synthetica's core library 'synthetica.jar').
2. Enable the Synthetica Look and Feel at startup time in your application:
import de.javasoft.plaf.synthetica.SyntheticaBlackMoonLookAndFeel;
try
{
UIManager.setLookAndFeel(new SyntheticaBlackMoonLookAndFeel());
}
catch (Exception e)
{
e.printStackTrace();
}
答案 0 :(得分:2)
这意味着您缺少依赖类。如果你看一下要求,它还需要“Synthetica Standard Look and Feel”
您可以下载here
答案 1 :(得分:1)
如果您已下载 .jar -file,则需要将其添加到eclipse中的构建路径中。
即。如果您在eclipse项目中有一个目录 lib ,您可以在其中放置 .jar 文件,然后右键单击您的jar文件并选择 Build Path < / em>然后添加到构建路径。
答案 2 :(得分:0)
我知道问题可能已经解决,因为这是一篇非常古老的帖子,但是这可能会影响其他当前用户(比如我自己):
点击“确定”并启用主题,您可以使用以下代码:
try {
UIManager.setLookAndFeel(new SyntheticaBlueMoonLookAndFeel());
} catch (Exception e) {
e.printStackTrace();
}