Results 1 to 3 of 3

Thread: Apply fonts dynamically

  1. #1
    Join Date
    Aug 2004
    Location
    Gent
    Posts
    4

    Default 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. #2
    Join Date
    Aug 2004
    Posts
    229

    Default

    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 at 05:19 AM.

  3. #3
    Join Date
    Aug 2004
    Location
    Gent
    Posts
    4

    Default

    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.

Similar Threads

  1. Replies: 2
    Last Post: Oct 21st, 2005, 11:42 AM
  2. Replies: 3
    Last Post: Oct 19th, 2005, 03:32 PM
  3. PerformanceMonitorInterceptor
    By tnist in forum AOP
    Replies: 3
    Last Post: Aug 24th, 2005, 01:39 PM
  4. Replies: 1
    Last Post: Feb 24th, 2005, 03:18 PM
  5. Replies: 13
    Last Post: Dec 3rd, 2004, 10:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •