Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Help with this code

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what's wrong with it. It's saying

4 errors found:
File: J:\Java\Java Acces\bookClasses\craps.java [line: 11]
Error: J:\Java\Java Acces\bookClasses\craps.java:11: craps is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener
File: J:\Java\Java Acces\bookClasses\craps.java [line: 24]
Error: J:\Java\Java Acces\bookClasses\craps.java:24: cannot find symbol
symbol : class JLabe1
location: class craps
File: J:\Java\Java Acces\bookClasses\craps.java [line: 54]
Error: J:\Java\Java Acces\bookClasses\craps.java:54: cannot find symbol
symbol : variable sumLabel
location: class craps
File: J:\Java\Java Acces\bookClasses\craps.java [line: 55]
Error: J:\Java\Java Acces\bookClasses\craps.java:55: cannot find symbol
symbol : variable sumLabel
location: class craps

And it's weird, because I have ALL of the required packages. I'm fairly new at this, but I really enjoy it. Any help would be greatly appreciated.

Here is the code


 
author
Posts: 23919
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You declare a class that is a ActionListener. This requires you to implement the actionPerformed() method. If you look closely, you will see that you didn't implement that method.

Henry
 
Jason Newman
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How would I do this? I'm REALLY new(ish).
 
Henry Wong
author
Posts: 23919
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jason Newman wrote:How would I do this? I'm REALLY new(ish).



Hint: Check your spelling.

Henry
 
Marshal
Posts: 75679
354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have methods you are trying to override or implement from interfaces, put the @Override annotation before the method header. Then you will get a "does not override" error if you have spelt it wrongly.
 
Jason Newman
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for all the help, It's great to have a helpful place for Java outside of school. If I get the method working, I'll set the status as 'resolved'. Thank you again for the help!
 
I'm so happy! And I wish to make this tiny ad happy too:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic