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-22 08:37 pm (UTC)(link)
Shoot. The combo box (a lightweight component) is probably getting obscured by the Canvas (a heavyweight component). This is what I get for testing on OS X where everything is a native component. I'll test with Linux and see if I can come up with an all-lightweight solution. You should be able to change selection with the up and down arrow keys, though.