jdk/src/share/classes/javax/swing/border/TitledBorder.java
changeset 13236 80fab7a1ebd6
parent 11268 f0e59c4852de
child 20458 f2423fb3fd19
--- a/jdk/src/share/classes/javax/swing/border/TitledBorder.java	Fri Jul 06 14:20:27 2012 +0400
+++ b/jdk/src/share/classes/javax/swing/border/TitledBorder.java	Thu Jul 12 16:54:47 2012 +0200
@@ -440,7 +440,7 @@
      * @return the title-font of the titled border
      */
     public Font getTitleFont() {
-        return titleFont;
+        return titleFont == null ? UIManager.getFont("TitledBorder.font") : titleFont;
     }
 
     /**
@@ -449,7 +449,7 @@
      * @return the title-color of the titled border
      */
     public Color getTitleColor() {
-        return titleColor;
+        return titleColor == null ? UIManager.getColor("TitledBorder.titleColor") : titleColor;
     }
 
 
@@ -681,10 +681,6 @@
         if (font != null) {
             return font;
         }
-        font = UIManager.getFont("TitledBorder.font");
-        if (font != null) {
-            return font;
-        }
         if (c != null) {
             font = c.getFont();
             if (font != null) {
@@ -699,10 +695,6 @@
         if (color != null) {
             return color;
         }
-        color = UIManager.getColor("TitledBorder.titleColor");
-        if (color != null) {
-            return color;
-        }
         return (c != null)
                 ? c.getForeground()
                 : null;