This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
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
Joined: Feb 03, 2009
Posts: 44
posted
0
class MiniMusicPlayer, line 66 - You override method paintCompenent instead of paintComponent after correcting method name works fine for me
Brian Pianczk
Ranch Hand
Joined: Jan 26, 2009
Posts: 45
posted
0
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
Joined: Jun 09, 2003
Posts: 4632
posted
0
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.