aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/awt/Component.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/awt/Component.java')
-rw-r--r--libjava/java/awt/Component.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/libjava/java/awt/Component.java b/libjava/java/awt/Component.java
index 98511ef..11663a7 100644
--- a/libjava/java/awt/Component.java
+++ b/libjava/java/awt/Component.java
@@ -1866,12 +1866,17 @@ public abstract class Component
* @param height the height of the image
* @return the requested image, or null if it is not supported
*/
- public Image createImage(int width, int height)
+ public Image createImage (int width, int height)
{
- if (GraphicsEnvironment.isHeadless())
- return null;
- GraphicsConfiguration config = getGraphicsConfiguration();
- return config == null ? null : config.createCompatibleImage(width, height);
+ Image returnValue = null;
+ if (!GraphicsEnvironment.isHeadless ())
+ {
+ if (isLightweight () && parent != null)
+ returnValue = parent.createImage (width, height);
+ else if (peer != null)
+ returnValue = peer.createImage (width, height);
+ }
+ return returnValue;
}
/**