Code to set accent color of FlatLaf

Code to set accent color of FlatLaf

2022/05/09 Java Programming 0
UIManager.setLookAndFeel(new FlatLightLaf());
				
FlatLaf.setGlobalExtraDefaults(Collections.singletonMap("@accentColor", "#ff0000"));
Class<? extends LookAndFeel> lafClass = UIManager.getLookAndFeel().getClass();
FlatLaf.setup(lafClass.newInstance());
FlatLaf.updateUI();

Leave a Reply

Your email address will not be published.