2003/10/17 07:20:15
[org.ibex.core.git] / src / org / xwt / plat / AWT.java
index 3dfd153..771bdbb 100644 (file)
@@ -131,7 +131,15 @@ public class AWT extends JVM {
             mediatracker.addImage(img, 1);
             try { mediatracker.waitForAll(); } catch (InterruptedException e) { }
             mediatracker.removeImage(img);
-            this.i = img;
+            synchronized(AWTPixelBuffer.class) { 
+                if (AWTPixelBuffer.component == null) {
+                    AWTPixelBuffer.component = new Frame();
+                    AWTPixelBuffer.component.setVisible(false);
+                    AWTPixelBuffer.component.addNotify();
+                }
+            }
+            this.i = AWTPixelBuffer.component.createImage(w, h);
+            this.i.getGraphics().drawImage(img, 0, 0, null);
         }
     }