-
Bug
-
Resolution: Fixed
-
P4
-
9
-
b25
A focus event has an attribute that describes the cause of the focus transfer. One option is MOUSE_EVENT, which indicates that the focus transfer was triggered by a mouse event. Many Swing components request a focus transfer in response to a mouse event, but fail to supply a Cause when requesting focus. A focus event listener will find the cause to be UNKNOWN, but MOUSE_EVENT would be more appropriate.
I have found this problem in:
Text Components (see DefaultCaret)
BasicButtonListener
BasicComboPopup (see Handler and delegateFocus)
BasicScrollBarUI (see TrackListener and ArrowButtonListener)
BasicSliderUI (see TrackListener) and AquaSliderUI
BasicSpinnerUI (see ArrowButtonHandler) and AquaSpinnerUI
BasicTabbedPaneUI (see Handler)
GTKColorChooserPanel (see ColorTriangle)
AquaTextFieldSearch (see button listener)
I also note that SwingUtilities2 has helper methods that request focus, but
no equivalents that accept a Cause.
I also note that Accessibility supports requestFocus without a cause.
Should the cause be set to MOUSE_EVENT because Accessibility is basically
simulating a mouse event, or should there be a Cause parameter so that other options can be supported?
I have found this problem in:
Text Components (see DefaultCaret)
BasicButtonListener
BasicComboPopup (see Handler and delegateFocus)
BasicScrollBarUI (see TrackListener and ArrowButtonListener)
BasicSliderUI (see TrackListener) and AquaSliderUI
BasicSpinnerUI (see ArrowButtonHandler) and AquaSpinnerUI
BasicTabbedPaneUI (see Handler)
GTKColorChooserPanel (see ColorTriangle)
AquaTextFieldSearch (see button listener)
I also note that SwingUtilities2 has helper methods that request focus, but
no equivalents that accept a Cause.
I also note that Accessibility supports requestFocus without a cause.
Should the cause be set to MOUSE_EVENT because Accessibility is basically
simulating a mouse event, or should there be a Cause parameter so that other options can be supported?
- relates to
-
JDK-8309041 Swingutilities2 methods requesting focus can have a Cause
-
- Open
-
-
JDK-8154434 Open the request focus methods of the java.awt.Component which accept FocusEvent.Cause
-
- Resolved
-
-
JDK-8309060 Compilation Error in javax/swing/event/FocusEventCauseTest.java
-
- Resolved
-
-
JDK-8080395 consider making sun.awt.CausedFocusEvent functionality public
-
- Resolved
-
(1 links to)