--- old/src/java.desktop/share/classes/sun/awt/LightweightFrame.java 2015-03-04 18:16:08.000000000 +0300 +++ new/src/java.desktop/share/classes/sun/awt/LightweightFrame.java 2015-03-04 18:16:08.000000000 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 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 @@ -91,7 +91,7 @@ @SuppressWarnings("deprecation") @Override public void addNotify() { synchronized (getTreeLock()) { - if (getPeer() == null) { + if (!isDisplayable()) { SunToolkit stk = (SunToolkit)Toolkit.getDefaultToolkit(); try { setPeer(stk.createLightweightFrame(this)); @@ -115,9 +115,9 @@ * @param activate if true, activates the frame; * otherwise, deactivates the frame */ - @SuppressWarnings("deprecation") public void emulateActivation(boolean activate) { - ((FramePeer)getPeer()).emulateActivation(activate); + final FramePeer peer = AWTAccessor.getComponentAccessor().getPeer(this); + peer.emulateActivation(activate); } /**