Hi Kerim,

> : It hangs at createImage(200,200), which obviously returns null. Then of
> course I cannot draw on the offscreen Graphics since it is also null.
> Where is the error ?

Since an offscreen image is supposed to be the same format as the screen
you are on, it does not know what format of image to return until it is
associated with some screen.  Thus, you have to add it to a hierarchy
of components in a Frame before it can do its work.  (We should probably
have thrown a descriptive exception here instead of simply returning null,
but it is too late to change the behavior and spec).

I don't think that the Frame needs to be shown for the createImage to
work, just that the component needs to be added to some frame (or some
container within some Frame).

Try lazily creating your offscreen image after you are part of a
Component hierarchy...

                                ...jim

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to