--- old/src/java.desktop/share/classes/javax/swing/JComponent.java 2015-03-04 18:16:03.000000000 +0300 +++ new/src/java.desktop/share/classes/javax/swing/JComponent.java 2015-03-04 18:16:03.000000000 +0300 @@ -57,6 +57,7 @@ import static javax.swing.ClientPropertyKey.*; import javax.accessibility.*; +import sun.awt.AWTAccessor; import sun.awt.SunToolkit; import sun.swing.SwingUtilities2; import sun.swing.UIClientPropertyKey; @@ -4218,9 +4219,10 @@ * @param c the {@code Component} to be checked * @return true if this component is lightweight */ - @SuppressWarnings("deprecation") public static boolean isLightweightComponent(Component c) { - return c.getPeer() instanceof LightweightPeer; + // TODO we cannot call c.isLightweight() because it is incorrectly + // overriden in DelegateContainer on osx. + return AWTAccessor.getComponentAccessor().isLightweight(c); } @@ -5033,7 +5035,6 @@ this.paintingChild = paintingChild; } - @SuppressWarnings("deprecation") void _paintImmediately(int x, int y, int w, int h) { Graphics g; Container c; @@ -5159,7 +5160,7 @@ } // If the clip width or height is negative, don't bother painting - if(c == null || c.getPeer() == null || + if(c == null || !c.isDisplayable() || paintImmediatelyClip.width <= 0 || paintImmediatelyClip.height <= 0) { recycleRectangle(paintImmediatelyClip);