src/share/classes/javax/swing/text/DefaultCaret.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -1497,14 +1497,19 @@
             return (int) (aspectRatio * height) + 1;
         }
 
         if (caretWidth > -1) {
             return caretWidth;
-        }
-
+        } else {
+            Object property = UIManager.get("Caret.width");
+            if (property instanceof Integer) {
+                return ((Integer) property).intValue();
+            } else {
         return 1;
     }
+        }
+    }
 
     // --- serialization ---------------------------------------------
 
     private void readObject(ObjectInputStream s)
       throws ClassNotFoundException, IOException