• Post Reply Bookmark Topic Watch Topic
  • New Topic

Picture.java with swapBackground

 
Ryan O'Neill
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

2 errors found are found after I run my code:
File: /Users/ryoneill/Desktop/m/Picture.java [line: 899]
Error: /Users/ryoneill/Desktop/m/Picture.java:899: cannot find symbol
symbol : variable y
location: class Picture
File: /Users/ryoneill/Desktop/m/Picture.java [line: 906]
Error: /Users/ryoneill/Desktop/m/Picture.java:906: cannot find symbol
symbol : variable y
location: class Picture
 
Paweł Baczyński
Bartender
Posts: 1971
39
Firefox Browser IntelliJ IDE Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Errors happen in lines 899 and 906. The code you posted has 103 lines...

Error: /Users/ryoneill/Desktop/m/Picture.java:899: cannot find symbol
symbol : variable y
location: class Picture


Above error means that you are trying to use variable y which is not declared. And this happens on line 899.
What more can I say when I don't see the code?

Note that you might have declared variable y somewhere else in your code but it is not visible in the scope of code bloct at line 899.
 
Ryan O'Neill
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I could add in the code but it is about another 800 lines.
 
Campbell Ritchie
Marshal
Posts: 53140
124
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't edit posts like that; it makes the answers look confused. And you will don't seem to have line 899 in the right place.
Please post line 899.
Your code has inconsistent indentation and inconsistent use of {}. Both should be consistent; we have some suggestions here. If you had used consistent indentation and braces, you would find it much easier to read your way around the code, and could see where y was declared.
 
Ryan O'Neill
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I will start from the beginning.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!