Reputation: 221
I thought it would be nice if I gave the user the ability to choose and switch between "themes" (L&Fs). I'd give him a choice between Java metal (default), System default, and maybe a couple more I'll download from the internet...
My application is also bilingual (you can pick between two languaes to be displayed). However, it's important for my application to be fully translated. I can handle the simple stuff, naming JLabels, JButtons, titles of frames, etc...
But there are also some predefined components whoose string I cannot manage as easely (e.g. JFileChooser). I was told that I could change them using the UIManager, but that their strings are L&F specific.
Now, regardless to how much fun would be translating my application for each and every L&F, I hope there is some centralised way of controlling those strings.
After all, JFileChoose (e.g.) is the same component, no matter the L&F that is used, right? It prints text on the same parts of itself, no? So, there should be something I could access that would grant me "master" control over the text that is printed onto the predefined components, I assume...
Any ideas?
Upvotes: 1
Views: 90
Reputation: 109823
not easy job,
have to read Modifying the Look and Feel
most important is Changing the Look and Feel After Startup
have to accept that you have to override value for Keys into UIManeger too, NOTICE about one of Look and Feel
is possible that different L&F
have got various Font
s and Colors
for concrete JComponents
, multiply by Native OS
in some cases is important if you'll to change Color
or ColorUIResources
(Font
or FontUIResources
)
JFileChooser
is compound JComponents
, you can to extract its members,
best place to start could be this idea,
Nimbus Look and Feel lives with own life
Upvotes: 2