Doug Landauer
My personal website.
 

 

Software -- small example Scala programs

As I am learning the Scala Programming Language (Winter - Spring 2004), I'll put here some of the example programs I come up with.

sbw_db8
db8 == 2004 February 8. My first little scala program since getting the 1.0.0b8 release. The purpose of this one is to test and verify how scala interacts with Java libraries, in particular, Swing.

Just as with Scala traits, you implement a Java interface by saying "with" in a class definition heading. As in

class foo with ActionListener { ... }

The sbw_db8 program just puts up a little window without even a panel, just an exit button that doesn't work until at least 6 repaints have occurred.

I tried this out on Mac OS X, Windows XP, and Solaris. There are some Swing-related behavior issues; these are due to my inexperience with Swing, not to Scala itself.


Click here to visit the Radio UserLand website. Click to see the XML version of this web page. © Copyright 2006 Doug Landauer .
Last update: 06/5/19; 03:51:01 .
Click here to send an email to the editor of this weblog.