This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • 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
Posts: 22122
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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!