• 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 wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

HFJ BeatBox program, problems

 
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey everyone,

I am going though the Head First Java 2nd ed nicely.

I made up the BeatBox program on chapter 13 page 420, and it worked nicely.

I was finished chapter 14 and tried to add in the inner classes to make the program save the beat.

and add in more buttons for this to happen.

I done all that, and it came up with many errors, so many in fact that it said the original program was wrong.

so I undid all the changes, and tried to compile, now I went through the program with a fine tooth comb, it is perfectly the same as the book, so it should work again, but it will not compile.

I have noticed that there was a program on page 437 called Box, whixh I made up, as I like to see things work, so I understand them.

I have since got rid of this class Box, cause I think this was making the main BeatBox program not work.

However, I still get lots of errors, and I am not sure why as it worked before with the exact same code.

here is my beatbox code:


here is a screen shot of my errors which I never got the last time.

can someone help?

Davy

[ November 23, 2006: Message edited by: Davy Kelly ]
[ November 23, 2006: Message edited by: Davy Kelly ]
 
Ranch Hand
Posts: 2412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to your output the problem is in the class Box. If you look at the individual errors, they will tell you what is expected.
 
Davy Kelly
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Keith,

What I was asking is why did it compile fine and run fine in the first place?
ok I made a few changes, but I have set the code back to its original working order, so it should work fine now, but its not

davy
 
Davy Kelly
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have downloaded the code from O'reilly the Code Kitchen jar file.

I extracted the files and saved the BeatBoxSaveOnly.java file in where all my other java files save and get compiles from.

I compiled this file, and this returned 11 errors.

again saying there is a problem with the Box class, which I see is a class within the java language.

I am at a loss, I have spent all day trying to figure this out, but to no avail.

I cannot add buttons to the buttonBox, as the main problem is with the class Box.

Can someone help please, instead of telling me the compilation errors tell me what the problem is?

davy
[ November 24, 2006: Message edited by: Davy Kelly ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic