Here are some Swing links that you might have missed during the last week:
- Jacek Furmankiewicz writes about release 0.2 of SwingBuilder project that allows declarative UI binding via a YAML file. The project aims to address many of Swing’s pain points, such as verbosity, event listeners, layout management, data binding, background long running tasks, internationalization and more.
- Looks like the Eclipse Albireo project that promised easy embedding of Swing components in SWT applications is losing some steam. According to Gordon Hirsch‘s post on the dev mailing list, both active developers (Gordon himself and Bruno Haible) are being reassigned a th their jobs, making it problematic to devote much time to bringing Albireo to beta and release status. With no community participation in development, looks like the project is heading towards stagnation.
- Geertjan Wielenga overviews four of the available Java desktop frameworks (missing a couple of others in the process), giving some general advice on choosing the right framework for your project. A sound collection of tips which can be extended to pretty much any other programming field.
- Geertjan is playing with the Swing Explorer project (by Maxim Zakharenkov) and explores its NetBeans integration. A noteable feature is jumping from the painting stack trace back into the NB source editor for the matching method.
- Jasper Potts continues his series on customizing Nimbus appearance. He has posted a useful program that lists all Nimbus-specific UIManager entries, along with the graphics representation of the matching values (painters, borders, insets, colors, fonts). It gives a great visual overview of the entries that can be customized, even if a few rows show weird visuals (such as RadioButtonMenuItem[Disabled+Selected].checkIconPainter).
- Christopher Deckers has announced release 0.9.6 of DJ Native Swing project that aims to bring native components, such as web browser, Flash player, video player or HTML editor into Swing applications. This release provides better integration logic with foreign native components.
- Having problems skinning custom Swing components under the Swing system look-and-feel? SWT 3.5 might have an answer for you. One of the items for SWT 3.5 is to “provide an API to draw operating system themed controls and parts of controls”. As i have shown with native text rasterization, you don’t need to wait for Swing to provide the missing functionality (although it is most certainly nice when they do so).
- And finally, Christophe Le Besnerais has the second part of his quest to create a modern-looking UI application in Swing, talking about breadcrumb bar, glowing icons and custom-shaped frames.
This is all over the Russian web sites, so i thought to translate it to English. I am most definitely not the original author.
Before having a baby…
To get a feeling about the coming nights, go around the room from five till ten in the evening holding a bundle weighing 6 to 10 pounds. At ten put the bundle down, set the alarm clock to twelve and go to sleep. Wake up at midnight and walk around the room holding the bundle until one o’clock. Set the alarm clock to three. Since you’re not going to fall asleep, get up at two and drink something. Go to bed at 2:45. Get up at three with the alarm. Sing in the dark until four. Set the alarm clock to five. Get up and make breakfast. Repeat for five years. Look happy.
Remove all the pulp from a watermelon and make a small side hole the size of a ping-pong ball. Hang it on the ceiling with a rope and swing from side to side. Take a bowl of wet cereal and try to use a spoon to put the cereal in the swinging watermelon, jumping like a grass hopper. Continue until the bowl is half empty. Empty the rest on your lap. You’re ready to feed a one-year old baby.
To get ready for the first steps of a baby, put peanut butter on the sofa and all the window drapes. Take a fishstick, shove it behind the entertainment center and leave it there for a couple of months.
It seems much easier to dress little children than it really is. Buy a fishnet bag and an octopus. Try to put the octopus into the fishnet bag so that none of the tentacles is sticking out. You have the whole morning to complete the exercise.
Forget about sportcars and buy yourself a minivan. Buy a chocolate icecream cone and put it in the glovebox. Leave it there. Squeeze a bag of cookies over the back seats. Take a rake and scratch both sides of the car. Excellent! Do you like it?
Prepare to go outside, then wait for half an hour next to the bathroom. Go outside. Go back. Go outside. Go back once again. Go outside and take a stroll. Go back. Take a stroll once again. Go along the road very slowly for five minutes. Stop every ten seconds to stare at cigarette butts, disposed chewing gums, dirty pieces of paper and dead insects. Go back. Loudly scream that you’ve had enough and you can’t take it any longer. Make sure that the neighbours are out and staring at you. You’re ready to try and take a toddler for a walk.
Go to a grocery store and take a creature most similar to a preschooler. A grown up goat is an ideal fit. If you’re planning to have more than one kid, take more than one goat. Buy your usual groceries, keeping an eye on the goats. Pay for everything that the goats eat or break.
Just before having your own baby, find a married couple that already have kids and point out the faults in how they train the kids, how they lack any patience and how they let their kids go crazy. Give advice on better sleep habits, potty training, good table manners and just good behavior. Don’t forget to enjoy yourself – this is the last time you’re going to have answers to any of these questions.
Starting today i am discontinuing support for Substance NetBeans module, including fixing bugs and synchronizing the module with Substance core libraries.
The development of this module was greatly facilitated in the beginning by Tim Boudreau, but unfortunately was met with less than lukewarm support from the NetBeans team (see comments on issue 66335 and issue 67463). A little over a year ago this module has been broken by the changes scheduled to appear in NetBeans 6.0, but those changes had been rolled back a month later, making the module usable once again. However, the core NetBeans code has not evolved to make it more friendly to third-party look-and-feels, and the development of Substance module has not been as productive and fulfilling as it could have been (as indeed was the case with SwingX).
Today marks the last day that this module is supported by me. It has been removed from the NetBeans plugin portal, and last sync with the core Substance library has been uploaded to the Documents & Files section of the java.net project. If you are interested in taking over the maintenance and development of this project on java.net, feel free to contact me at kirillcool [.at.] yahoo [@at@] com.
The demo applications for the Flamingo JRibbon component make heavy use of the SVG icons to make sure that the icons can be scaled without losing visual details. While Flamingo provides Batik-based implementation of the ResizableIcon interface, this has proven to place a noticeable burden on CPU during the application startup phase. One of the ways to address this performance issue is to use the SVG-Java2D transcoder that is part of Flamingo core distribution.
There’s nothing like eating your own dog food, and while trying to use the transcoded Java2D class to replace the runtime SVG decoding i found that it was lacking some of the basic functionality. The most glaring one was lack of API to query the default bounds of the SVG image. This is now exposed in the Java2D class with two static methods – getOrigWidth and getOrigHeight.
The second enhancement to the org.jvnet.flamingo.svg.SvgTranscoder class is the new setJavaToImplementResizableIconInterface(boolean) method. If you call this method prior to calling the transcode(), the resulting class will implement the org.jvnet.flamingo.common.icon.ResizableIcon interface, making it ready to be used instead of the org.jvnet.flamingo.svg.SvgBatikResizableIcon class. This comes handy since the heavy transcoding is done offline, and the size of the compiled class is comparable with the size of the compressed SVG file (especially if you turn the debugging info off). You can see the difference yourself by running the ribbon demo below – once the application frame is shown, all the icons are immediately visible and you can start interacting with it.

To change the package name of the generated Java2D class, call the setJavaPackageName(String) method prior to transcode() call. The last addition is the sample test.svg.SvgBatchConverter class that shows how to run the SVG-Java2D conversion in batch mode on all SVG files in a given folder.
Using the offline transcoding has another advantage – you don’t need to bundle the Batik jars that are around 3-4MB heavy. One point left to your consideration is the issue of the license of the original SVG images and its implications on the transcoded Java2D classes.