diff --git a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java index 6fe38ab7592a4128aed6e95f663a444a60c88587..7d5e237948cd2f0f7def3ef0e04c7ccef3cc8c1a 100644 --- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java +++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, 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 @@ -644,6 +644,9 @@ public class WindowsLookAndFeel extends BasicLookAndFeel "released SPACE", "released" }), + "Caret.width", + new DesktopProperty("win.caret.width", null), + "CheckBox.font", ControlFont, "CheckBox.interiorBackground", WindowBackgroundColor, "CheckBox.background", ControlBackgroundColor, diff --git a/src/share/classes/javax/swing/text/DefaultCaret.java b/src/share/classes/javax/swing/text/DefaultCaret.java index 79a0ceee1d4b9e7cf8e413a10853e6a231f70cad..40a4af016ecdff56d92daa6053927ad2b894f237 100644 --- a/src/share/classes/javax/swing/text/DefaultCaret.java +++ b/src/share/classes/javax/swing/text/DefaultCaret.java @@ -1,5 +1,5 @@ /* - * 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 @@ -1503,9 +1503,14 @@ public class DefaultCaret extends Rectangle implements Caret, FocusListener, Mou if (caretWidth > -1) { return caretWidth; + } else { + Object property = UIManager.get("Caret.width"); + if (property instanceof Integer) { + return ((Integer) property).intValue(); + } else { + return 1; + } } - - return 1; } // --- serialization --------------------------------------------- diff --git a/src/windows/native/sun/windows/awt_DesktopProperties.cpp b/src/windows/native/sun/windows/awt_DesktopProperties.cpp index 8d13a97249a090a69f79cb1572df08c0c7fe2f27..6b50ec15c09583681587f3acf2b930a8526a26c5 100644 --- a/src/windows/native/sun/windows/awt_DesktopProperties.cpp +++ b/src/windows/native/sun/windows/awt_DesktopProperties.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -70,6 +70,7 @@ void AwtDesktopProperties::GetWindowsParameters() { GetNonClientParameters(); GetIconParameters(); GetColorParameters(); + GetCaretParameters(); GetOtherParameters(); GetSoundEvents(); GetSystemProperties(); @@ -636,6 +637,10 @@ void AwtDesktopProperties::GetSoundEvents() { SetSoundProperty(TEXT("win.sound.start"), TEXT("SystemStart")); } +void AwtDesktopProperties::GetCaretParameters() { + SetIntegerProperty(TEXT("win.caret.width"), GetIntegerParameter(SPI_GETCARETWIDTH)); +} + BOOL AwtDesktopProperties::GetBooleanParameter(UINT spi) { BOOL flag; SystemParametersInfo(spi, 0, &flag, 0); diff --git a/src/windows/native/sun/windows/awt_DesktopProperties.h b/src/windows/native/sun/windows/awt_DesktopProperties.h index 2bfe7e03c1dd5bb563eca5b88e025954f5e11651..e93530ef2082aa3d13d32fb7f3ca4a0f8f4d285b 100644 --- a/src/windows/native/sun/windows/awt_DesktopProperties.h +++ b/src/windows/native/sun/windows/awt_DesktopProperties.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -64,6 +64,7 @@ class AwtDesktopProperties { void GetColorParameters(); void GetOtherParameters(); void GetSoundEvents(); + void GetCaretParameters(); static BOOL GetBooleanParameter(UINT spi); static UINT GetIntegerParameter(UINT spi);