flwyd: (java logo)
flwyd ([personal profile] flwyd) wrote2007-04-22 01:52 pm

Chaos Game Applet

[Chaos Game] I spent most of yesterday and the first part of today writing a Java applet implementation of the Chaos Game. I find that the color schemes help significantly to understand why configurations lead to the patterns they do. The original description (which explains verbally better than I have) just featured monochrome images.

While I write Java code every day at work, most of it is data-focused. Data-focused GUIs (put this field over here, put these buttons in this panel over here) are important and often tricky to get right, but it's been years since I did anything with public void paint(Graphics g). Playing with code which requires no database, no metadata configuration, and no client-server communication was also refreshing.

You'll need at least Java 1.4 to view the applet. I compiled from Eclipse running under Java 1.5 and while I don't think I used any new API methods I didn't have a 1.4 JVM convenient for testing. Let me know if you can't get it to work.

[identity profile] flwyd.livejournal.com 2007-04-25 05:40 am (UTC)(link)
Bug fixed. Turns out there's no JCanvas because subclassing JComponent accomplishes the same goal.