This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Picture.java with swapBackground

 
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
 
Bartender
Posts: 2233
63
IntelliJ IDE Firefox Browser Spring Java Linux
  • 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.
 
Marshal
Posts: 70258
282
  • 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.
 
    Bookmark Topic Watch Topic
  • New Topic