Set look and feel color

时光毁灭记忆、已成空白 提交于 2019-12-01 00:50:23
mKorbel

1.set for changes is little bit hacky, have to set L&F, then after is possible to make any changes to instaled L&F

pseudocode

if( "Nimbus".equals( info.getName() ) ) {
   UIManager.setLookAndFeel(info.getClassName());
   UIManager.getLookAndFeelDefaults().put("Xxx", "Xxx")
   UIManager.getLookAndFeelDefaults().put("Xxx", "Xxx")
   break;
}

2.Font and part of Colors is stored as XxxUIResources for all Swings L&Fs, and XxxUIResources required another hack,

3.better could be to use UIManager Defaults by @camickr for list of instaled methods, rather than searching into NimbusDefaults

4.about Painter, you can to set own Painter (depends of type or value in UIDefaults) or to override XxxUIResources (depends of type, sometimes, somewere doesn't works, because development of Nimbus ended somwhere in 2nd. of quaters),

EDIT

5.Nothing better around, I think that @aephyr participated of Nimbus development or e.i. ???

I've found the major problem. I didn't call SwingUtilities.updateComponentTreeUI( window ) after putting all look & feel properties into the UIDefaults.

Now it performs the way I intended it to.

Another question: Is there a way to specify the preferred font of the whole application?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!