Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set all Java Swing GUI component backgrounds and foreground(fonts) colors at once?

I have tons of jbuttons, jtextfields, jlabels, jmenus, gui items and it is extremely time consuming to set the background color and foreground color one at a time.

I want to be able to color the fonts(foreground) and backgrounds all the jmenus, jmenuitems,jtextfields,jbuttons, etc quickly/concisely in my project instead of having to set them one at a time.

Is there any technique to do this more concisely instead of doing it one at a time?

like image 883
Philip Nguyen Avatar asked Dec 03 '22 05:12

Philip Nguyen


1 Answers

1) most eficient way would be to use Custom Look and Feel, part of them have got a nice Themes

2) set value to the UIDefault, Listing UIDefault Properties

EDIT:

best of all UIManager Defaults by @camickr

like image 122
mKorbel Avatar answered Dec 09 '22 15:12

mKorbel