<Swing Dev> [9] Review Request for 7172652: With JDK 1.7 text field does not obtain focus when using mnemonic Alt/Key combin

Alexander Scherbatiy alexandr.scherbatiy at oracle.com
Thu May 14 15:19:06 UTC 2015


   The fix looks good to me.

   Thanks,
   Alexandr.

On 5/14/2015 10:25 AM, Semyon Sadetsky wrote:
> Alexander, thanks. all is relevant.
> http://cr.openjdk.java.net/~ssadetsky/7172652/webrev.02/
>
> --Semyon
>
>
> On 5/13/2015 6:06 PM, Alexander Scherbatiy wrote:
>> On 5/8/2015 12:13 PM, Semyon Sadetsky wrote:
>>> updated: http://cr.openjdk.java.net/~ssadetsky/7172652/webrev.01/
>>
>>    - Should the labelFor request focus in the method 
>> BasicLabelUI.doRelease(...) as it was before the fix
>>    - There are some formatting problems (space after a method 
>> argument on line 507, bracket on line 534)
>>    -  It seems that inputMap.put() in doPress() method also can be 
>> changed to putOnRelease()
>>    - frame.dispose() also should be called on EDT in the test
>>
>>    Thanks,
>>    Alexandr.
>>
>>>
>>>
>>> On 4/28/2015 4:31 PM, Alexander Scherbatiy wrote:
>>>>
>>>>   Is it possible to make code shorter by adding methods like:
>>>>   putOnRelease(InputMap inputMap, int keyCode, int modifiers)
>>>>   removeOnRelease(InputMap inputMap, int keyCode, int modifiers)
>>>>
>>>>   Thanks,
>>>>   Alexandr.
>>>>
>>>> On 4/20/2015 5:53 PM, Semyon Sadetsky wrote:
>>>>> Hello,
>>>>>
>>>>> please review a fix for JDK9:
>>>>>
>>>>> webrev: http://cr.openjdk.java.net/~ssadetsky/7172652/webrev.00/
>>>>> bug: https://bugs.openjdk.java.net/browse/JDK-7172652
>>>>>
>>>>> ***ROOT CAUSE
>>>>> This is a bug in Label UI's key release event processing routine 
>>>>> for key mnemonics: only one release event is captured instead of 
>>>>> two (Alt release and the mnemonic key release). The Alt release 
>>>>> event goes up on hierarchy and is captured by the parent internal 
>>>>> frame's menu bar for which Alt key release means selection change 
>>>>> event under the Windows system LnF.
>>>>>
>>>>> ***SOLUTION
>>>>> Change key release event handling logic to capture events from 
>>>>> both Alt modifier and the key. The logic takes into account that 
>>>>> when the first release key event come it transfers focus back to 
>>>>> the field so the second key release event should be captured from 
>>>>> any window component.
>>>>>
>>>>> ***TESTING
>>>>> A simple scenario is written to exclusively cover the situation.
>>>>>
>>>>> --Semyon
>>>>>
>>>>
>>>
>>
>




More information about the swing-dev mailing list