Announcement Announcement Module
Collapse
No announcement yet.
Apply fonts dynamically Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #2
    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
    Last edited by robyn; May 19th, 2006, 06:19 AM.

    Comment


    • #3
      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.

      Comment

      Working...
      X