MacWidgets – Java Swing looking native on OS X

I just discovered Exploding Pixels’ MacWidgets. Its a beautiful library. Literally just pasted a couple of lines of code into my Java app and now it looks right at home on the os x desktop. I’m running JDK 1.6 on Leopard.

Here is is in action:


And here is the code (its been edited slightly so may not copy and paste, but you get the idea) …

        UnifiedToolBar toolBar = new UnifiedToolBar();
        JButton button = new JButton(“My Button”);
        button.putClientProperty(“JButton.buttonType”, “textured”);
        getContentPane().add(toolBar.getComponent(), BorderLayout.NORTH);
        BottomBar bottomBar = new BottomBar(BottomBarSize.SMALL);
        bottomBar.addComponentToLeft(MacWidgetFactory.createEmphasizedLabel(” Status”));
        getContentPane().add(bottomBar.getComponent(), BorderLayout.SOUTH);