• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Class Graphics2D not found

 
Theresa Duick
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm receiving the following error message when I attempt to use Graphics2D & GradientPaint in my code. Since this is part of Java 2, I wondering does this mean that I don't have it properly installed? Please help.
C:\J21work>javac ScreenTest.java
ScreenTest.java:13: Class Graphics2D not found.
Graphics2D screen2D = (Graphics2D)screen;
ScreenTest.java:14: Class GradientPaint not found.
GradientPaint pat = new GradientPaint(0f,0f,Color.white,110f,45f,Color.b
lue);
 
paul wheaton
Trailboss
Pie
Posts: 21896
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you importing java.awt.* ; ??
 
Theresa Duick
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! That solved my problem. I imported several individual awt classes, but not the whole lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic