Search code examples
javaswinglook-and-feelnimbus

how to change background color for nimbus look and feel using java


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) {}

Solution

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

    from the l&f tutorial