I think the code you posted might not be the working code since a, b and c 
don't seem to exist in it. :P

Check out the docs for the createImage(int, 
int)<http://docs.oracle.com/javase/7/docs/api/java/awt/Component.html#createImage(int,
 
int)> method:

*Returns:**an off-screen drawable image, which can be used for double 
buffering. The return value may be null if the component is not 
displayable. This will always happen ifGraphicsEnvironment.isHeadless()
 returns true.*

It seems you have to make the JFrame visible in order to get an image when 
using that method. 

The following should work:

*(let [frame (doto (JFrame.)*
*                  (.setSize 100 100)*
*                  (.setVisible true))*
*      height (.getHeight frame)*
*      width (.getWidth frame)*
*      image (.createImage frame height width)] *
*      image)*

Cheers,

Juan

On Tuesday, January 8, 2013 11:38:35 PM UTC-3, Jacob Goodson wrote:
>
> (let [frame (doto (JFrame.)
>                         (.setSize 100 100))
>       height (.getHeight a)
>       width (.getWidth a)
>       image (.createImage a b c)] 
>       image)
>
> Why does this return nil?
>
> Thank you!
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to