[英]How to use third party themes in swing application?
I want to use some third party themes (like synthetica http://www.javasoft.de/synthetica/themes/ ) in my swing appliaction. 我想在自己的挥杆动作中使用一些第三方主题(例如,合成类http://www.javasoft.de/synthetica/themes/ )。 i am using
eclipse ide
, got the jar file of theme and did the following modification(according to the readme file from the theme) in my code 我正在使用
eclipse ide
,获取了主题的jar文件,并在我的代码中做了以下修改(根据主题的自述文件)
try
{
UIManager.setLookAndFeel(new SyntheticaBlackMoonLookAndFeel());
}
catch (Exception e)
{
e.printStackTrace();
}
but after this modification its showing the following error 但经过此修改后,它显示以下错误
The type de.javasoft.plaf.synthetica.SyntheticaLookAndFeel cannot be resolved. It is indirectly referenced from required .class files
what does this mean? 这是什么意思? i tried searching on net but cant really find any useful answers
我尝试在网上搜索,但找不到真正有用的答案
Contents of Readme file: 自述文件的内容:
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();
}
If you have downloaded the .jar -file, then you need to add it to your build path in eclipse. 如果您已下载.jar -file,则需要将其添加到eclipse中的构建路径中。
Ie if you in your eclipse project have a directory lib where you put your .jar -files, then right-click on your jar-file and chose Build Path then Add to Build Path . 即,如果您在eclipse项目中具有放置.jar文件的目录lib ,则右键单击jar文件并选择Build Path,然后选择Add to Build Path 。
I know that the issue might have been resolved as this is a very old post, but as this may contribute other current users (like myself): 我知道这个问题可能已经解决,因为这是一篇很老的文章,但是因为这可能会导致其他当前用户(例如我自己):
Click "Ok" and the to enable theme, you can use this code: 点击“确定”,然后启用主题,您可以使用以下代码:
try { UIManager.setLookAndFeel(new SyntheticaBlueMoonLookAndFeel()); } catch (Exception e) { e.printStackTrace(); }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.