如何使用Java更改Nimbus外观的背景颜色 [英] how to change background color for nimbus look and feel using java

查看:116
本文介绍了如何使用Java更改Nimbus外观的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Java Swing应用程序中,我正在尝试灵巧的外观.它在JdesktopPane控件中看起来很棒,但是我希望所有桌面窗格都使用不同的颜色,但是主题很好.

In Java Swing application, I am trying nimbus look and feel. It looks excellent in JdesktopPane control but i want the different color for my all desktoppane but theme is fine.

有没有办法改变灵气外观的背景颜色?

Is there any way to change the background color of nimbus look and feel?

以下是应用灵巧外观的示例代码.

Here is the sample code to apply the nimbus look and feel.

   try {
        for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
          if ("Nimbus".equals(info.getName())) {
          UIManager.setLookAndFeel(info.getClassName());
          break;
         }
        }
       }  
     catch (Exception e) {}

推荐答案

UIManager.put("nimbusBase", new Color(...));
UIManager.put("nimbusBlueGrey", new Color(...));
UIManager.put("control", new Color(...)) 

来自 l& f教程

这篇关于如何使用Java更改Nimbus外观的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆