Groovy Bar & Grill

April 11, 2007

Groovy TimeBox

Filed under: Groovy Grill — jawild59 @ 5:05 am

Here’s my humble solution to the TimeBox quiz posted over at GroovyQuiz.

Screenshot

Screenshot

A couple of things I think are noteworthy

  1. Populating a comboBox with a range is slick. comboBox(items:1..12) results in Integers with values 1 – 12 inserted into the combo box model. Getting the selected value is even slicker: cb.selectedItem.
  2. SwingBuilder doesn’t make it any easier to work with layout managers, at least as far as I could see. Not that I expected it to but it would have been nice.
  3. Lesson learned: ‘5′ as Integer is NOT the same as ‘5′.toInteger().
  4. Because I used SwingWorker, Java 6 is required.

download and rename to Timebox.jar

[Update: Rather than repost code as I make changes, I'll provide a link to download the code and include a current screen shot so you can determine if you've got the most recent version]

Blog at WordPress.com.