File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MiniMusicPlayer HFJ

 
Brian Pianczk
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK I have two sets of code here both, to me, look to be the same except for style differences. One I wrote from doing the section in the book MiniMusicPlayer. The other was a direct copy and paste MiniMusicPlayer3.
Mine doesn't work, it plays the track, but doesn't display the random rectangles. The copied and pasted code works.
I can't recognize the difference in the two codes,(myDrawPanel is named different in the two, but referenced the same way) I am curious if anyone else can see something I am not seeing?


Mine


Copied version

 
Bartek Myszkowski
Ranch Hand
Posts: 44
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
class MiniMusicPlayer, line 66 - You override method paintCompenent instead of paintComponent
after correcting method name works fine for me
 
Brian Pianczk
Ranch Hand
Posts: 45
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you! I looked over this code again and again. Even line by line and did not notice. Even when I pinpointed it to that bit of code.

Thanks again!
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for future reference, had you done this

@Override//<---------
public void paintCompenent (Graphics g) {

the compiler wopuld have spat this out
"method does not override or implement a method from a supertype"
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic