Thursday, August 07, 2008

Java Swing Balloon Tip

I am developing a GUIs with Java Swing. Awesome, everything fine. Now, today I needed something like tool-tip or balloon pop-up to show various messages. In particular, I find that there are no standard form validation framework, so I created one, ripping off ideas from Zope Formulator. And the validation trigger suppose to pop-up a balloon tip when something wrong and focus the widget. That's fine, validation works perfect, unless you need a balloon tip.

I found one "decent" balloon tip on https://balloontip.dev.java.net/ site. Here how it looks like in Windows with Metal L&F: (pic is taken from the site directly):

Well, it's OK. It's Windows and mostly everything looks ugly there even in Vista, so a combination of blue frame on bluish gray with a squarish hint might be OK for environment that lacks taste and design. But what about Mac? — yeah, I am snob-like a--hole here, sorry. OK, what about Gnome or KDE on Linux and/or Sun Solaris? Windows is not the only OS these days anymore. So here how the whole thing looks like in Mac:


Notice ugly corners and quite crappy close button, not mention that a close button does not fits into a balloon tip paradigm. Well, my double-advice to all Java developers who sticks on Windows platform (there are two messages in one):

People, PLEASE install Linux and/or Solaris to make sure you are NOT providing funny things!..


*sigh*

So and now this is how it should look like (took for me less than two hours to rework entire source code, throwing lots of things):


Now I am happy. :-)

P.S. And yes, it does not need a close button — just click on it...