File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes color help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "color help" Watch "color help" New topic
Author

color help

AjayG Shah
Greenhorn

Joined: Aug 28, 2012
Posts: 4
Folks,
Below is a code I have been writing on my own (well a modification from what online version read). The error has been highlighted.



The error message reads: "green cannot be resolved to a variable". I really have no clue what this means. If somebody can help me 1)understand what this message actually means for future reference and 2) how to resolve the issue, I will really appreciate it.
Thanks a lot!!!
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Ajay,

Try to do some googling its quiet easy question and also plese use the code tag here.Dont post code without any code tags.

Here , you have taken the color type as string so you need to put the green in quotes which will solve the problem.

Regards
Jatan

AjayG Shah
Greenhorn

Joined: Aug 28, 2012
Posts: 4
Jatan,
Thank you for your reply!
1) What is code tag?
2) When are quotes NOT required? :S

Thank you! I apologize for not aligning my message as per the rules. Just a newbie here!!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39784
    
  28
If you write green, the compiler thinks you want the variable of that name. If you write "green", that means a String with the contents green.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39784
    
  28
I have added code tags, but that highlighted the iffy indentation. Have a look at some suggestions about indentation here.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: color help