<AWT Dev> [9] Review request for 8073453: Focus doesn't move when pressing Shift + Tab keys

Anton V. Tarasov anton.tarasov at oracle.com
Thu Apr 9 11:10:12 UTC 2015


Hi Dmitry,

Well, the fix seems correct to me. I tried to thought of any possible regressions but nothing came 
to my mind (let's suppose this was really a mistake in the code).

However, wouldn't you like to do the same for swing's SortingFocusTraversalPolicy? And also, include 
it into the test scenario?

(Hope you've run all the focus related regression tests).

Thanks,
Anton.

On 06.04.2015 10:14, dmitry markov wrote:
> Hello,
>
> Could you review the fix for jdk9, please?
>
>     bug: https://bugs.openjdk.java.net/browse/JDK-8073453
>     webrev: http://cr.openjdk.java.net/~dmarkov/8073453/jdk9/webrev.00/
>
> Problem description:
> The method ContainerOrderFocusTraversalPolicy.getLastComponent() always returns null if the last 
> component is a container with focus traversal policy and does not have any sub-components. In some 
> cases such behaviour of getLastComponent() causes failure during reverse focus transition, (i.e. 
> focus stays on the selected component when SHIFT+TAB is pressed).
>
> Fix:
> If the last component is a container with focus traversal policy and does not have any 
> sub-components, the method getLastComponent() should return a previous component instead of null.
> Please note: the same approach is already implemented for 
> ContainerOrderFocusTraversalPolicy.getFirstComponent().
>
> Thanks,
> Dmitry



More information about the awt-dev mailing list