I would like to be able to change the locale in my Swing application at runtime and have all the text elements on the screen update themselves with localized text from a Res
There's two obvious approaches I see:
Instead of getting a String from the ResourceBundle, get some kind of event-source String holder. Document would be the very heavy solution, but anything that can handle replacing an immutable value will do. Instead of just setting the text on a label, say, have a method that also sets up a listener. Note, this quite a "heavy" solution.
Alternatively, have a central repository of listeners that are fired on a locale change, that each then go back and re-execute the relevant part of the set up code (don't duplicate). For common cases where you have, say, a JLabel using a resource string literally, then you can combine these all into one listener with a WeakHashMap. Sometimes it works out better to avoid lots of little listeners.