-
Apply fonts dynamically
Is it possible to apply a font to an RCP application when the application is already running and visible?
I'v tried using the UIManager. Startup went well, but once the application is visible, no changes are made.
Code:
Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof FontUIResource) {
UIManager.put(key, configuration.getFont());
}
Also I'v tried, starting from the rootPane, apply the font to all component (using recursion), but the result doensn't apply on all of them.
Is there a solution to apply fonts at runtime?
-
Take a look at my last post in this thread: http://forum.springframework.org/sho...241&highlight=
I provide code that dynamically adjusts font size after an app has already started. It could easily be adapted to dynamically adjust the font itself after the app is started.
- Andy
-
Thx Andy.
The problem is solved for the main application view.
But I'm still having trouble with the JPopupMenu and some other dialogs, that have been cached, it seems to be they don't get the updateUI calls.