Change UI Lookup for ProgressBar Swing in Nimbus Theme

后端 未结 3 1413
离开以前
离开以前 2021-01-25 10:20

I want to change Color of Progressbar from Default-Orange to Green for Nimbus UI in NetBeans.

I have added following lines

for (javax.swing.UIManager.Loo         


        
3条回答
  •  旧时难觅i
    2021-01-25 10:55

    A quick solution for me: change the nimbusOrange color for all components, if you dont write your own Painter.

    UIDefaults defaults = UIManager.getLookAndFeelDefaults();
    NimbusLookAndFeel localNimbusLookAndFeel = (NimbusLookAndFeel)UIManager.getLookAndFeel();
    Color derivedColor = localNimbusLookAndFeel.getDerivedColor("nimbusBase", 0.03054375F, -0.3835404F, -0.0980392F, 0, true);
    defaults.put("nimbusOrange",derivedColor);
    

提交回复
热议问题