-
Bug
-
Resolution: Not an Issue
-
P3
-
None
-
21, 22, 23
-
b04
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
MacBook Pro 13-inch M2 2022. Sonoma 14.4
openjdk 21.0.3 2024-04-16 LTS
OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode)
A DESCRIPTION OF THE PROBLEM :
When focus is gained on a JEditorPane with editable set to false, the caret is displayed.
When focus is gained, DefaultCaret.focusGained is called, and subsequently DefaultCaret.setVisible(true) is called regardless if the component is editable or not.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a JEditorPane and set editable = false
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Caret is not set to visible when the component is not editable.
ACTUAL -
When focus is gained, caret is made visible
CUSTOMER SUBMITTED WORKAROUND :
Add a focus listener onto the component and when focus is gained, set caret.visible = false
FREQUENCY : always
MacBook Pro 13-inch M2 2022. Sonoma 14.4
openjdk 21.0.3 2024-04-16 LTS
OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode)
A DESCRIPTION OF THE PROBLEM :
When focus is gained on a JEditorPane with editable set to false, the caret is displayed.
When focus is gained, DefaultCaret.focusGained is called, and subsequently DefaultCaret.setVisible(true) is called regardless if the component is editable or not.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a JEditorPane and set editable = false
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Caret is not set to visible when the component is not editable.
ACTUAL -
When focus is gained, caret is made visible
CUSTOMER SUBMITTED WORKAROUND :
Add a focus listener onto the component and when focus is gained, set caret.visible = false
FREQUENCY : always
- relates to
-
JDK-4512626 Non-editable JTextArea provides no visual indication of keyboard focus
-
- Closed
-