src/java.desktop/windows/classes/sun/awt/windows/WKeyboardFocusManagerPeer.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 26,35 ****
--- 26,38 ----
package sun.awt.windows;
import java.awt.Window;
import java.awt.Component;
import java.awt.peer.ComponentPeer;
+
+ import sun.awt.AWTAccessor;
+ import sun.awt.AWTAccessor.ComponentAccessor;
import sun.awt.KeyboardFocusManagerPeerImpl;
import sun.awt.CausedFocusEvent;
final class WKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
static native void setNativeFocusOwner(ComponentPeer peer);
*** 44,56 ****
private WKeyboardFocusManagerPeer() {
}
@Override
- @SuppressWarnings("deprecation")
public void setCurrentFocusOwner(Component comp) {
! setNativeFocusOwner(comp != null ? comp.getPeer() : null);
}
@Override
public Component getCurrentFocusOwner() {
return getNativeFocusOwner();
--- 47,59 ----
private WKeyboardFocusManagerPeer() {
}
@Override
public void setCurrentFocusOwner(Component comp) {
! final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
! setNativeFocusOwner(comp != null ? acc.getPeer(comp) : null);
}
@Override
public Component getCurrentFocusOwner() {
return getNativeFocusOwner();