Thanks to Luke Nezda, Mac Widgets for Java now has a pom.xml file to work with Maven. Luke’s looking to get the pom file integrated into java.net’s Maven repository. Until then, you’ll have to download it manually.

mac_widgets_snow_leopard

Mac Widgets for Java has been updated to work with Snow Leopard. The Unified Tool Bar, Preferences Bar and Bottom Bar all needed small updates. The textured window in Snow Leopard uses slightly lighter colors, possibly to compensate for the increased gamma correction values, which causes everything to look darker and more saturated.

These updates will be part of the next release (0.9.6), but you can also download the latest developer build here. Be sure to report any issues you have on Snow Leopard, as well as any regressions on Leopard.

iAppScrollbar_top_and_bottom
Thanks to Kathryn Huxtable, Mac Widgets for Java now offers iApp scrollbars with buttons at the top-and-bottom/left-and-right (instead of together at the bottom/right).

I’ve incorporated Kathryn’s changes, which you can get via the Subversion repository or via the latest developer build. To split the buttons, as seen in the screen shot above, call IAppWidgetFactory.setIAppScrollBarButtonsSeparate(true).

iTunes_Table-promo-new
HUDControlsUpdate1-promo-updated
I’ve just released Mac Widgets for Java 0.9.5 (download it here). The major addition in this release is an iTunes style table. I’ve also added a HUD style radio button, made HUDs transparent on non-Mac platforms and completed a number of SourceList enhancements and bug fixes.

Users of the Unified Tool Bar and Bottom Bar will note that these components have been promoted to full classes rather than the awkward factory methods (which had been located in MacWidgetFactory). The API is still evolving, most liking breaking API consumers on upgrade, which is why I’m keeping the library pre-1.0.

You’ll find the full list of enhancements and fixes here, or you can browse the API here. Also, you can see an example that uses the new iTunes table here.

hud_on_windows

I finally got around to making the Heads Up Display (HUD) use transparency on non-Mac platforms. I wanted to keep compatibility with Java 5, so I decided to use reflection to try and gracefully use the com.sun.awt.AWTUtilities.setWindowOpaque method. Here are the two utility methods I use to make a window non-opque:

    /**
     * Try's to make the given {@link Window} non-opqaue (transparent) across 
     * platforms and JREs. This method is not guaranteed to succeed, and will fail
     * silently if the given {@code Window} cannot be made non-opaque.
     * 
     * This method is useful, for example, when creating a HUD style window that 
     * is semi-transparent, and thus doesn't want the window background to be
     * drawn.
     * @param window the {@code Window} to make non-opaque.
     */
    public static void makeWindowNonOpaque(Window window) {
        // on the mac, simply setting the window's background color to be fully 
        // transparent makes the window non-opaque.
        window.setBackground(new Color(0, 0, 0, 0));
        // on non-mac platforms, try to use the facilities of Java 6 update 10.
        if (!PlatformUtils.isMac()) {
            quietlyTryToMakeWindowNonOqaque(window);
        }
    }

    /**
     * Trys to invoke {@code com.sun.awt.AWTUtilities.setWindowOpaque(window, false)} 
     * on the given {@link Window}. This will only work when running with JRE 6 update 10 
     * or higher. This method will silently fail if the method cannot be invoked.
     * @param window the {@code Window} to try and make non-opaque.
     */
    private static void quietlyTryToMakeWindowNonOqaque(Window window) {
        try {
            Class clazz = Class.forName("com.sun.awt.AWTUtilities");
            Method method = 
                    clazz.getMethod("setWindowOpaque", java.awt.Window.class, Boolean.TYPE);
            method.invoke(clazz, window, false);
        } catch (Exception e) {
            // silently ignore this exception.
        }
    }

This enhancement will be part of Mac Widgets for Java 0.9.5, which will hopefully be out in the next few weeks. If you want access earlier, you can either download the code and build it from the Subversion repository, or you can email me and I’ll send you the latest jar file.

Swing can be oh so sweet

March 23, 2009

If you had any doubts that Swing could deliver truly beautiful apps, then check out Dirk Lemmermann’s latest endeavor below, which is using Mac Widgets for Java. Dirk is working on a product to enable collaborative enterprise project and issue management, called “Planner’s Workbench”, which he’s aiming to release this summer. He’s really helped refine and improve the Mac Widgets for Java API, as he’s really using this stuff.

By the way, if Dirk’s name sounds familiar, that’s probably because your familiar with his powerful FlexGantt UI Framework (another really nice piece of work).

bild-6
bild-3
bild-3-1
bild-2
bild-4

Update:
Dirk has posted more information about his app here.

hudcontrols-promo-new
darksourcelists-promo-new
I’ve just released Mac Widgets for Java 0.9.4. The major additions in this release are HUD style controls and the Dark Source List. Also, Source List colors can be fully customized via the new SourceListColorScheme interface.

You’ll find the full list of enhancements and fixes here, or you can browse the API here. Also, you can see examples that use these new widgets here.

iappscrollbars-promo-new

I’ve just released Mac Widgets for Java 0.9.3. The major addition is iApp style scroll bars, which you can learn how to use here. You’ll find the full list of enhancements and fixes here.

In the next few posts, I’ll be talking about the SkinnableScrollBarUI delegate and supporting infrastructure I created to support creating the iApp scroll bars.

Mac Widgets for Java – 0.9.2

September 29, 2008


I’ve just released Mac Widgets for Java version 0.9.2. I’ve added a Heads Up Display (HUD) component and factored out the UI delegate from SourceList so that you can make any JTree look like a Source List. You’ll find the full list of enhancements and fixes here.

Mac Widgets for Java – 0.9.1

September 14, 2008

Java Unified Tool Bar
Java Bottom Bar
I just released Mac Widgets for Java version 0.9.1. I’ve added official support for the Unified Tool Bar and Bottom Bar, and refactored various bits of the API based on the great feedback I’ve received so far. The API is still fluid, so don’t be surprised if your code requires minor tweaks with the latest version. Also, a few people have asked for runnable demo code, which you’ll now find under the demo directory in the Subversion repository.

What components are coming next? A preferences widget and Heads Up Display (HUD) are on the way. What widgets would you like to see?