CanvasJAI error on repaint???

I get this error with a CanvasJAI as rendering scene:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.media.jai.GraphicsJAI
        at sun.awt.RepaintArea.paint(RepaintArea.java:215)
        at apple.awt.ComponentModel.handleEvent(ComponentModel.java:251)
        at java.awt.Component.dispatchEventImpl(Component.java:4097)
        at java.awt.Component.dispatchEvent(Component.java:3869)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

It seems not to recgnize Graphics of CanvasJAI that are supposed to be a GraphicsJAI instance.see javadoc

I’ve tried to override the Canvas.getGraphics() by the same way CanvasJAI would do it, but it throws the same classCastException.
So I changed the CanvasJAi for a Canvas without overriding the getGraphics() method and it works fine…
:stuck_out_tongue: