Yes, it's curious. Thanks for taking time to look at this. Here are the relevant Java bits. First the painter interface:
Here's the Java call to the painter implementation (created and registered from javascript - see painter code in previous reply). I verified the Graphics2D imported in the class and used for the first parameter is java.awt.Graphics2D. This is ImagePanel line 631 from the stack trace below:
Finally, the stack trace when using the --illegal-access=debug. Potentially interesting bit in bold:
WARNING: Illegal reflective access by org.mozilla.javascript.MemberBox (file:/home/brad/dev/photogrok/rhino-1.7.7.2.jar) to method sun.java2d.SunGraphics2D.drawString(java.lang.String,float,float)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:225)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
at org.mozilla.javascript.gen.c_4._c_anonymous_1(:7)
at org.mozilla.javascript.gen.c_4.call()
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:399)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3452)
at org.mozilla.javascript.gen.c_4.call()
at org.mozilla.javascript.InterfaceAdapter.invokeImpl(InterfaceAdapter.java:137)
at org.mozilla.javascript.InterfaceAdapter$1.run(InterfaceAdapter.java:83)
at org.mozilla.javascript.Context.call(Context.java:526)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:509)
at org.mozilla.javascript.InterfaceAdapter.invoke(InterfaceAdapter.java:86)
at org.mozilla.javascript.jdk13.VMBridge_jdk13$1.invoke(VMBridge_jdk13.java:132)
at com.sun.proxy.$Proxy6.paint(Unknown Source)
at photogrok.ImagePanel.paintComponent(ImagePanel.java:631)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1075)
at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:908)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1084)
at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:908)
at java.desktop/javax.swing.JSplitPane.paintChildren(JSplitPane.java:1024)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1084)
at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:908)
at java.desktop/javax.swing.JSplitPane.paintChildren(JSplitPane.java:1024)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1084)
at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:908)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1084)
at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:908)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1084)
at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:908)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1084)
at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:590)