Keilly: osx
Showing posts with label osx. Show all posts
Showing posts with label osx. Show all posts

Tuesday, June 10, 2008

Creating a Swing Dashboard Widget - Part 9 (Examples)

So the widget code is beta complete. With some tidying and refactoring it's time to create some simple examples.

Clock Widget Launch
Weather Widget Launch
(Systems other than OSX* require Java 6 update 10)



With the widget specific code pushed into a base class, these two examples just needed code to gather some information and paint themselves: About 100 lines each.

ClockWidget Code:These examples are just a taste of what's possible, rather than meant be really useful as working widgets - e.g. the weather widget is hard coded to San Francisco and could do with some better graphics.
They also illustrate one real advantage over traditional Javascript widgets in the use of the familiar libraries which are shipped as part of the base JDK. The weather reads an Yahoo XML feed and the clock uses a date formatter, both easily done in Java with no external libraries to download, license, ship, or understand.

Source code and summary next.

*I managed to fix the earlier OSX rendering problems by explicitly clearing the graphics before each frame. The widgets will now run on OSX with no additional downloads (Java 1.5).

Tuesday, June 12, 2007

ZX Spectrum Widget in WWDC Keynote

While being embarrassed for a room full of grown men enthusiastically cheering and whooping at the announcement of a new 'Finder', I spotted that Steve Jobs was sharing the WWDC 2007 stage with a huge OSX feature that he somehow neglected to mention: My ZX Spectrum widget.
It's on around minute 45, blink very slowly and you'll miss it.