File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Cannot find symbol compiler error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Cannot find symbol compiler error" Watch "Cannot find symbol compiler error" New topic
Author

Cannot find symbol compiler error

Jonathan Squires
Greenhorn

Joined: Oct 05, 2011
Posts: 3
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

Joined: Apr 06, 2010
Posts: 4421
    
    8

Check the documentation carefully. There is no Color.DARKGRAY field. But there is one very similar.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39396
    
  28
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

Joined: Oct 05, 2011
Posts: 3
Yeah thanks guys really appreciate the help

And thanks for the welcome!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39396
    
  28
You’re welcome ( )
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot find symbol compiler error