This fixes the font and color of JLabel in the Metal L&F.

2005-04-15  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/plaf/metal/MetalLookAndFeel.java
        (initComponentDefaults): Added Label.font.
        (initSystemColorDefaults): Added this method and adjusted the
        general control color.

/Roman

Index: javax/swing/plaf/metal/MetalLookAndFeel.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/metal/MetalLookAndFeel.java,v
retrieving revision 1.13
diff -u -r1.13 MetalLookAndFeel.java
--- javax/swing/plaf/metal/MetalLookAndFeel.java	15 Apr 2005 12:01:01 -0000	1.13
+++ javax/swing/plaf/metal/MetalLookAndFeel.java	15 Apr 2005 22:09:09 -0000
@@ -439,6 +439,8 @@
    * </tr><tr>
    * <td>Label.background</td><td>0xcccccc</td>
    * </tr><tr>
+   * <td>Label.font</td><td>[EMAIL PROTECTED] #getControlTextFont}</td>
+   * </tr><tr>
    * <td>Menu.background</td><td>0xcccccc</td>
    * </tr><tr>
    * <td>MenuBar.background</td><td>0xcccccc</td>
@@ -468,6 +470,7 @@
       "ProgressBar.background", new ColorUIResource(getControl()),
       "TabbedPane.background", new ColorUIResource(getControl()),
       "Label.background", new ColorUIResource(getControl()),
+      "Label.font", getControlTextFont(),
       "Menu.background", new ColorUIResource(getControl()),
       "MenuBar.background", new ColorUIResource(getControl()),
       "MenuItem.background", new ColorUIResource(getControl()),
@@ -475,4 +478,28 @@
     };
     defaults.putDefaults(myDefaults);
   }
+
+  /**
+   * Initializes the system color defaults.
+   *
+   * In particular this sets the following keys:
+   *
+   * <table>
+   * <tr>
+   * <th>Key</th><th>Value</th><th>Description</th>
+   * </tr><tr>
+   * <td>control</td><td>0xcccccc</td><td>The default color for components</td>
+   * </tr>
+   * </table>
+   */
+  protected void initSystemColorDefaults(UIDefaults defaults)
+  {
+    super.initSystemColorDefaults(defaults);
+    Object[] uiDefaults;
+    uiDefaults = new Object[] {
+      "control", new ColorUIResource(getControl())
+    };
+    defaults.putDefaults(uiDefaults);
+  }
+
 }
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to