Java Swing change colorscheme

35 Views Asked by At

I am currently developing a larger application and I want to be able to use a dark mode.

I am using the Look and Feel: UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

I do not want to use the Nimbus look and feel because i think it does not look good. Can i just change the default colors of this look and feel?

I have already tried around a lot by doing

Color control = UIManager.getColor("control");
Color info = UIManager.getColor("info");
Color text = UIManager.getColor("text");
UIManager.put("control", control);
UIManager.put("info", info);
UIManager.put("text", text);
SwingUtilities.updateComponentTreeUI(textEditor.getFrame());

But that didn`t work either.

I hope you can help me.

0

There are 0 best solutions below