File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot find symbol compiler error

 
Jonathan Squires
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey here is my code


and when I compile I get the following error:
ColorNameComponent.java:28: cannot find symbol
symbol : variable DARKGRAY
location: class java.awt.Color
g2.setColor(Color.DARKGRAY);
^
ColorNameComponent.java:30: cannot find symbol
symbol : variable LIGHTGRAY
location: class java.awt.Color
g2.setColor(Color.LIGHTGRAY);
^
2 errors


Any help would be greatly appreciated
 
Matthew Brown
Bartender
Posts: 4549
8
Java Netbeans IDE Scala
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the documentation carefully. There is no Color.DARKGRAY field. But there is one very similar.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch

You must be careful; even the tiniest spelling errors, as Matthew B is alluding to, will put the compiler off its stroke.
 
Jonathan Squires
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah thanks guys really appreciate the help

And thanks for the welcome!
 
Campbell Ritchie
Sheriff
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You’re welcome ( )
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic