<AWT Dev> [11] Review request for 8199748: Touch keyboard is not shown, if text component gets focus from other text component

Alexey Ivanov alexey.ivanov at oracle.com
Tue Apr 17 16:24:59 UTC 2018

Hi Anton,

Shouldn't touch keyboard remain visible if Tab key on the touch keyboard 
itself is pressed? Provided the next focusable component is a text 
component, of course.

Consider the following scenario: start Notepad and open Replace dialog. 
Touch "Find what" field: the touch keyboard appears. Press Tab on the 
touch keyboard: the focus moves to "Replace with" field and touch 
keyboard stays visible.


On 16/04/2018 13:03, Anton Litvinov wrote:
> Hello,
> Could you please review the following fix for the bug.
> Bug: https://bugs.openjdk.java.net/browse/JDK-8199748
> Webrev: http://cr.openjdk.java.net/~alitvinov/8199748/jdk11/webrev.00
> In the fix for JDK-8166772 it was deliberately implemented that the 
> touch keyboard is shown only on "MouseEvent.MOUSE_RELEASED" event and 
> is hidden on "FocusEvent.FOCUS_LOST" event.
> The reason of the bug is the fact that, when the touch keyboard is 
> already shown for one text component and a user touches another text 
> component, then the following 2 events occur in the presented order:
> 1. "MouseEvent.MOUSE_RELEASED" event arrives. The touch keyboard is 
> shown for the new text component.
> 2. "FocusEvent.FOCUS_LOST" event arrives for the previous text 
> component. The touch keyboard shown for the new text component becomes 
> hidden.
> The fix allows not to hide the touch keyboard during processing of 
> "FocusEvent.FOCUS_LOST" event, if the touch keyboard has just been 
> shown, as a result of processing of "MouseEvent.MOUSE_RELEASED" event, 
> for the component which gets focus "FocusEvent.getOppositeComponent()".
> Thank you,
> Anton

More information about the awt-dev mailing list