[英]want to implement jtattoo look and feel, but not working
I want to implement Acryl Look and Feel, it runs fine when i run file only, but when i run Main Project it returns the default l&F. 我想实现Acryl外观,仅在运行文件时运行良好,但是在运行Main Project时,它将返回默认的L&F。
public static void main(String args[]) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
/*if ("Windows".equals(info.getName())) {
* javax.swing.UIManager.setLookAndFeel(info.getClassName());
* break;
* }*/
UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel");
}
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(LoginForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
You don't have to loop and setting n-times in your code. 您不必在代码中循环和设置n次。
Just in your Main Project main()
put this line. 只需在您的Main Project
main()
放置这一行。
UIManager.setLookAndFeel("com.jtattoo.plaf.acryl.AcrylLookAndFeel");
重新检查您设置的主类,例如,登录表单可以是特定项目的主类。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.