Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

MacOS Dashboard Widgets

 

I recently got a Mac and took a look at their dashboard widgets. Such widgets consist of several files:
  • An HTML file
  • A CSS file
  • A JavaScript file
  • Image files

Of course, I had to try to see how hard it would be to do the same thing in F3. Here's the F3 version of the Calculator widget:

Unfortunately, it's currently impossible to create transparent windows in Java on non-MacOS platforms, so in those cases you won't see the dropshadow and rounded corners.

It only took a few minutes to write the visual elements in F3 (I just used F3Pad). And about another hour to add the behavior (I borrowed the design of the non-visual part of the calculator from an ancient Java applet I found on the net).

F3 Source:

Calculator.f3

Original Source:

Calculator.html
Calculator.css
Calculator.js