• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Picture.java with swapBackground  RSS feed

 
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: 2218
47
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.
 
Marshal
Posts: 64483
225
  • 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.
 
CAUTION! Do not touch the blades on your neck propeller while they are active. Tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!