JDK-7124310 : [macosx] "opposite" seems always null in focus events
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: generic
  • Submitted: 2011-12-23
  • Updated: 2014-10-13
  • Resolved: 2012-11-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8
7u40Fixed 8 b64Fixed
Description
http://java.net/jira/browse/MACOSX_PORT-619 submitted 2011/11/01 by Yuri Nesterenko
Run any application with FocusListener added to anything and look for opposite field in the events (event.getOppositeComponent()). It seems that it is too often (if not always) null.
I'm attaching a simple example but something more elaborate is necessary as a unit test I believe.

Comments
EVALUATION The test fails on a check for opposite gaining focus component when another component loses focus. Both the components belong to different frames. I checked that focus opposite is properly set on switching focus inside a toplevel. So, the problem is with an opposite when focus switches b/w toplevels. (I remember some native constraints in setting an opposite in cross window focus transfer.) Anyway, this bug seems not critical for 7u4.
28-02-2012

EVALUATION Author: Yuri Nesterenko Date: 01/Nov/11 07:53 AM Build: b214 closed/java/awt/Focus/ClearMostRecentFocusOwnerTest/ClearMostRecentFocusOwnerTest
23-12-2011