[英]How to use third party themes in swing application?
我想在自己的揮桿動作中使用一些第三方主題(例如,合成類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();
}
這意味着您缺少依賴類。 如果您查看要求,則還需要“ Synthetica標准外觀”
你可以在這里下載
如果您已下載.jar -file,則需要將其添加到eclipse中的構建路徑中。
即,如果您在eclipse項目中具有放置.jar文件的目錄lib ,則右鍵單擊jar文件並選擇Build Path,然后選擇Add to Build Path 。
我知道這個問題可能已經解決,因為這是一篇很老的文章,但是因為這可能會導致其他當前用戶(例如我自己):
點擊“確定”,然后啟用主題,您可以使用以下代碼:
try { UIManager.setLookAndFeel(new SyntheticaBlueMoonLookAndFeel()); } catch (Exception e) { e.printStackTrace(); }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.