Skip to content

Casting error #74

@ronchon65

Description

@ronchon65

Hello,
I recently tried to use VectorGraphics2D with the method indicated in the usage section. I declare somewhere in my application:
Graphics2D g2 = new VectorGraphics2D();
At run time, on this statement:
CommandSequence commands = ((VectorGraphics2D) g2).getCommands();
I get a cast error:
Exception in thread "AWT-EventQueue-1" java.lang.ClassCastException: sun.java2d.SunGraphics2D cannot be cast to de.erichseifert.vectorgraphics2d.VectorGraphics2D
and I don't understand what happens. What is wrong ?
I tried several java versions, from 8 to 11, the last one is openjdk 11.0.7-ea 2020-04-14.
Thanks in advance for your help !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions