-
Bug
-
Resolution: Duplicate
-
P2
-
None
-
1.1.3
-
generic
-
generic
ingrid.yao@Eng 1997-07-29
Problem reported by Oracle:
WM_ACTIVATE processing tries to set the focus to the Component that had the
focus last time the window was activated. WWindowPeer.getFocusPeer() tries to
cast a Component's peer to WComponentPeer, which causes a ClassCastException
for LW Components. The method needs to return the HW ancestor of the LW
Component:
Proposed fix:
WComponentPeer getFocusPeer() {
Component c = ((Window)target).getFocusOwner();
while (c != null) {
ComponentPeer peer = c.getPeer();
if (peer != null && peer instanceof WComponentPeer) {
return (WComponentPeer) peer;
} else {
// peerless sub-component, try parent.
c = c.getParent();
}
}
return null; // no child has focus
}
- duplicates
-
JDK-4068077 WM_Active does not set focus correctly for LW components
- Closed