Graphics2d NPE?

Hi all.
I was trying to get this snippet to work: (the
java one works well, the jruby scripting java one results in:

Exception in thread “AWT-EventQueue-0”
sun/java2d/d3d/ validateContext': java.lang.NullPointerException: null (NativeException) from sun/java2d/pipe/ 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?