Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Casting error #74

Open
ronchon65 opened this issue Jun 16, 2020 · 0 comments
Open

Casting error #74

ronchon65 opened this issue Jun 16, 2020 · 0 comments

Comments

@ronchon65
Copy link

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant