< prev index next >
src/java.desktop/windows/classes/sun/awt/windows/WComponentPeer.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2019, 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
@@ -577,10 +577,11 @@
Component target = (Component)getTarget();
Window window = SunToolkit.getContainingWindow(target);
if (window != null) {
final WWindowPeer wpeer = AWTAccessor.getComponentAccessor()
.getPeer(window);
+ if (wpeer != null) {
Graphics g = wpeer.getTranslucentGraphics();
// getTranslucentGraphics() returns non-null value for non-opaque windows only
if (g != null) {
// Non-opaque windows do not support heavyweight children.
// Redirect all painting to the Window's Graphics instead.
@@ -596,10 +597,11 @@
g.clipRect(0, 0, target.getWidth(), target.getHeight());
return g;
}
}
+ }
SurfaceData surfaceData = this.surfaceData;
if (surfaceData != null) {
/* Fix for bug 4746122. Color and Font shouldn't be null */
Color bgColor = background;
< prev index next >