This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Head First Java, Ch12, MiniMusicPlayer3 not working as advertised Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Head First Java, Ch12, MiniMusicPlayer3 not working as advertised" Watch "Head First Java, Ch12, MiniMusicPlayer3 not working as advertised" New topic
Author

Head First Java, Ch12, MiniMusicPlayer3 not working as advertised

Ashley Bye
Ranch Hand

Joined: Jan 30, 2013
Posts: 46

I'm working through the above book and am stuck trying to find why the program doesn't run as I would expect. It compiles, it runs and it plays the midi track but there are no rectangles drawn in the panel. If I change to or remove the if statement entirely, then I get one rectangle drawn before any sound plays, so the paintComponent method is doing part of its job. I've tried running the program on both Linux F18 and OS X, with the same result. The full source (sorry, it's longish) is included below.



"Twenty years from now you will be more disappointed by the things you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore. Dream. Discover." - Mark Twain
 
Consider Paul's rocket mass heater.
 
subject: Head First Java, Ch12, MiniMusicPlayer3 not working as advertised
 
Similar Threads
Head First Java problem
widget not loading in frame
Java Class hangs after run
HFJ Music Box Page 392
MiniMusicPlayer HFJ