• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Picture.java with swapBackground

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2235
63
IntelliJ IDE Firefox Browser Spring Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well I could add in the code but it is about another 800 lines.
 
Marshal
Posts: 74387
334
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok I will start from the beginning.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic