File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes <variable> cannot be resolved to a Variable ( Java Programming Eclipse ) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "<variable> cannot be resolved to a Variable ( Java Programming Eclipse )" Watch "<variable> cannot be resolved to a Variable ( Java Programming Eclipse )" New topic
Author

<variable> cannot be resolved to a Variable ( Java Programming Eclipse )

Johhn Davis
Greenhorn

Joined: Sep 20, 2012
Posts: 16
[Added code tags - see UseCodeTags for details]


Eclipse underlines msg in red and says "msg can not be resolved to a variable" inside method start() and graph(). There should be slightest error which i am unable to figure out. Need Help
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4369
    
    8

Welcome to the Ranch!

msg is declared in the init() method. That means its scope is limited to the init() method, and you can't refer to it anywhere else. If you want to be able to refer to it in the other methods you need to declare it at the class level.

By the way, remember Java is case-sensitive and you need to be careful about case. Your Start() method won't work because it's supposed to be start().
Johhn Davis
Greenhorn

Joined: Sep 20, 2012
Posts: 16
It works ..... Thanks Mr. Brown
 
Don't get me started about those stupid light bulbs.
 
subject: <variable> cannot be resolved to a Variable ( Java Programming Eclipse )