| 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: 3860
|
|
|
Check the documentation carefully. There is no Color.DARKGRAY field. But there is one very similar.
|
 |
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32830
|
|
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: 32830
|
|
You’re welcome ( )
|
 |
 |
|
|
subject: Cannot find symbol compiler error
|
|
|