aspose 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 Spring in Action this week in the Spring 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: 4422
    
    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
 
Consider Paul's rocket mass heater.
 
subject: <variable> cannot be resolved to a Variable ( Java Programming Eclipse )