1 Reply Latest reply: Oct 9, 2004 3:26 AM by 807587 RSS

    UIDefaults Key-Pair

    807587

      How to set the UIDefaults Key-Pair for SystemColors Class. Like if i wants to set a color for "menu" Key, then how do i set this value. kindly reply me.
        • 1. Re: UIDefaults Key-Pair
          807587
          Try this first:
              /**
               * Prints out UI defaults to a PrintStream.
               * 
               * @param out The printstream to write the defaults to.
               */
              public static void printUIDefaults(PrintStream out) {
                  UIDefaults uid = UIManager.getDefaults();
                  Enumeration e = uid.keys();
                  while (e.hasMoreElements()) {
                      Object key = e.nextElement();
                      Object value = uid.get(key);
                      out.println(key + " => " + value);
                  }
              }
          Look at which you want to change, then change it by calling
          UIManager.put(key, value);
          Or isn't this what you were looking for?