A Look and Feel Question

Discussion in 'Java' started by WDW, Aug 19, 2004.

  1. WDW

    WDW Guest

    How can I reset the UIDefaults before installing a new theme:?
    I will explain ...
    I set the cuurent theme to my own theme
    MetalLookAndFeel.setCurrentTheme(myTheme);
    with following changes to the UIDfeaults:
    public void addCustomEntriesToTable(UIDefaults table) {
    super.addCustomEntriesToTable(table);
    Color c1 = new Color(255, 0, 255);
    table.put("Button.foreground", c1);
    }
    After changing the theme to another theme - ie DefaultMetalThem - the
    foreground color of the button is still pink ...

    Some help please
    TIA
    Willy
     
    WDW, Aug 19, 2004
    #1
    1. Advertisements

  2. May be
    SwingUtilities.updateComponentTreeUI(yourFrame);
    fixes this.
    See http://java.sun.com/docs/books/tutorial/uiswing/misc/plaf.html#dynamic
     
    Thomas Fritsch, Aug 19, 2004
    #2
    1. Advertisements

  3. WDW

    zoopy Guest


    <untested>
    UIManager.getDefaults().putAll(new MetalLookAndFeel().getDefaults());
    </untested>
     
    zoopy, Aug 19, 2004
    #3
  4. Andrew Thompson, Aug 19, 2004
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.