JDK-8015652 : Regression : Focus doesn't move to button in SwingSet2 when a dialogue appears in JDK8b91
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7u21,8
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86
  • Submitted: 2013-05-30
  • Updated: 2013-06-27
  • Resolved: 2013-06-27
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 8
8Resolved
Related Reports
Duplicate :  
Description
focus does not move  to "ok" button when dialogue appears in jdk8b91.
This problme occurs in jdk7u21 as well, but does not in jdk6u45.

REPRODUCE:
1. Open SwingSet2.html in a browser like IE9.
2. Select [file]-[About Swing]
 A dialogue will appears.

EXPECTED :
 Focus is set to "ok" button.(Please see the attached jdk6u45_result.png)

ACTUAL :
 Focus is not set anywhere.(Please see the attached jdk8b91_result_new.png)


NOTE:
Suggested Fix(for jdk7) is provided.(diff4jdk7_en.txt)
Comments
This is the same problem as described in JDK-8014821. I've checked that it gets fixed by the same fix.
27-06-2013

Just added. ==> When a dialogue is opened in a frame in java application, WM_ACTIVATE is issued and notified in the following order. 1) WA_INACTIVE in the frame 2) WA_ACTIVE in the opened dialogue When java applicaiton receievs WA_ACTIVATE, java creates WindowEvent as follows. - When WindowEvent is WA_ACTIVE, java creates WINDOW_GAINED_FOCUS and notifies. - When WindowEvent is WA_INACTIVE, java creates WINDOW_LOST_FOCUS and notifies. On the other hand, a dialogue is opened in an applet, WM_ACTIVATE is passed as follows. 1) WA_INACTIVE in the frame in the browser 2) WA_ACTIVE in the opened dialogue 3) WA_INACTIVE caused by that the applet losts the focus In the WindowEvent operation of WINDOW_GAINED_FOCUS in 2), WINDOWS_LOST_FOCUS is notified to the frame in the applet. Then, in the WindowEvent operation of WINDOW_LOST_FOCUS in 3), the target window is replaced by the window which is having focus at the present. As a result, WINDOW_LOST_FOCUS is issued to the dialogue and the dialogue becomes inactive status. requestFocusInWindow() tries to set focus. KeyboardFocusManager.shouldNativelyFocusHeavyweight() checks whether a focus can be set or not. shouldNativelyFocusHeavyweight() does not set focus in the reported case because the source windows is different from the destinaiton window and the frame in the source window is null. <==
30-05-2013