Top.Mail.Ru
December 4th, 2006 - Java developers — LiveJournal
? ?

Java developers

December 4th, 2006
Image

12:16 am - Imagedelusory - Applet: Olympic Rings

For a class assignment, I am to write an applet that displays the Olympic rings and allows a user to play around with the colors of said rings. From what I see, I've gotten everything right... except that the buttons aren't doing anything. (However, if you're using Firefox, you'll see that something is happening. Once the applet is loaded and you click on "Random," try minimizing the browser or clicking on a different tab and then going back to the applet. The rings have changed color.)

This is the code.Collapse )

What am I doing wrong? I would appreciate any and all pointers. (Also. If you see something wrong or something that could be improved in my code, please point it out, too.)

Thanks a lot :)

--Allie

EDIT [12/13/2006]: Thanks for the responses, guys... but my professor told me that the problem was my call to repaint( ) in actionPerformed( ActionEvent e ). He said that my canvas should've been taking care of the repainting. He considers this to be a flaw in my design... but invoking the canvas's repaint( ) method by writing canvas.repaint( ) would [temporarily] do the trick. Thank you all for responding :D

Powered by LiveJournal.com
Image