Custom swing component

Dezember 21st, 2009 by Gerrit Diesen Artikel diskutieren »

During my vacation i’m playing around with the SunSPOT’s from Sun Microsystems which are fantastic little gadgets. (Please find more information about them here.)
I attached a combined temperature/humidity sensor to one of my spots and used xmpp protocol (with smack library) to communicate with my SunSPOT host application from wherever I am.
To visualize the measured values I needed something sexy and because there was nothing ready to go I created two little „instruments“ that I would like to share with you.

And here they are:

First a gauge:


Second Java Swing component is a display (yes I know it’s inspired by Apples iTunes):


Third custom Swing component a combination of the display with a led panel:


I think I’ll have to do some work at the 3d-effect of the rounded rectangle but as a first prototype they looked ok to me.

You can find my presentation on custom Swing components here, the Netbeans project for the components in the article can be downloaded here: Instruments, the Netbeans project for the application from the slides is here:

If you are interested, please leave a comment…


7 Antworten Verfasse eine Antwort

  1. Thomad sagt:

    Awesome, thanks for the article.

  2. SMiGL sagt:

    Hellful post. Thanks

  3. Very nice controls – and your presentation on creating custom Swing components to add some bling to your forms is excellent. Easily the clearest explanation of how to overload the paint method to make your forms look fantastic. Thanks for sharing this!

  4. pavan sagt:

    Thanks for the presentation document.

  5. Bob sagt:

    This is where Swing has always shined, creating really cool custom components. It’s such a shame Sun is abandoning a great mature framework like Swing.

  6. John Doe sagt:

    Very good article. After reading your presentation and your code I learned a lot.

  7. Asim sagt:

    Great work. Thanks for the sample projects and artical