Graphics2d NPE?

Hi all.
I was trying to get this snippet to work:

http://www.codecommit.com/blog/java/rapid-prototyping-with-jruby (the
java one works well, the jruby scripting java one results in:

Exception in thread “AWT-EventQueue-0”
sun/java2d/d3d/D3DRenderer.java:29:in validateContext': java.lang.NullPointerException: null (NativeException) from sun/java2d/pipe/BufferedRenderPipe.java:109:in fillRect’

I also get this exception

def paintComponent(g)

  g.java_send :setPaint, [java.awt.Paint], @paint

Exception in thread “AWT-EventQueue-0” test2.rb:18:in `java_send’:
cannot convert instance of class org.jruby.RubyModule to

are either of these two expected?
Thanks!
-r