Dynamic Swing OSGi Demo


I am preparing a few talks about dynamic OSGi applications. To get my hands dirty I started a little demo project to showcase different scenarios. That SWT works very well with OSGi is obvious, since Eclipse RCP is based on OSGi. But there are not many Swing based OSGi applications out there. That’s why I started playing around with the dynamic creation and deletion of Swing GUI.

The demo application shows how to use OSGi Declarative Services (DS) and Spring Dynamic Modules (Spring DM) together with Swing UI (and the Swing Application Framework, JSR 296). The goal of this project is to share best practices when it comes to dynamic OSGi-based applications.

The project home page is http://max-server.myftp.org/trac/pm. There you find a bit of documentation and how to get the sources from svn. The current implementation works well with Equinox, I haven’t tried out other OSGi implementations yet.

I would appreciate if OSGi experts take a look at the source code and help me improving the code base. Here is a screen shot:

Have fun!



  1. Alex Blewitt11-26-2008

    I agree that Swing apps using OSGi might dispel the myth that you need to use SWT. I put together a screencast and demo in conjunction with Neil Bartlett at http://www.eclipsezone.com/files/jsig/ for exactly that purpose. Of course as a live demo it couldn’t explore much but does give an idea of what it can do. Keep up the good work.

  2. Stuart McCulloch11-26-2008

    Interesting project – feel free to take a peek at our examples for the OSGi in Action book:


    it includes a Swing based paint program in three flavours: one for each OSGi layer (modularity, lifecycle – extender pattern, services – whiteboard pattern) to show that you can pick and choose which parts of OSGi you want to use.

    There’s also some low-level examples of dealing with service dynamics (we’ll be providing examples for the various component models like DS later on).

  3. Swing links of the week: November 30, 2008 : Pushing Pixels12-01-2008

    […] Kai Toedter has written a demo application that shows how to use OSGi Declarative Services (DS) and Spring Dynamic Modules (Spring DM) together with Swing UI (and the Swing Application Framework, JSR 296). The Person Manager project is licensed under EPL. […]

  4. Davide Raccagni12-03-2008

    I’m trying to checkout the project via svn but It still asks me to authenticate.

  5. Kai Tödter12-03-2008

    Hi Davide,

    Did you try “anonymous” as user (and an empty password)? If yes, I will check the authorization configuration…

  6. Davide Raccagni12-03-2008

    Hi Kai,
    yes, I did. I tried at https://max-server.myftp.org:444/svn/pm usr:anonymous, pwd:

  7. Davide Raccagni12-04-2008

    hi Kai,
    I was using a different SVN client: I tried from Eclipse and It works now. Well done.

  8. Pavel Kotlov03-25-2009

    Since I had some difficulties setting the target platform in 3.4.2 and your description of this important step is a one sentence hint i would think of pointing people to the preferences page of eclipse so no one else have the same problems starting to test your great app.
    Link http://eclipsesource.com/blogs/2009/02/24/target-platform-changes/

  9. Duchess | a Community of Female Java Developers05-23-2009

    […] After lunch I attended a talk by Martin Lipper about general tips on OSGI. A point he made there was that in order to reduce coupling it is preferable to import bundles rather than require them. Also another good point was about extension points; one should not misuse them. For instance if we are not sure who wants to use some particular functionality we should better expose it as a service. Next talk was about the use of OSGI for dynamic application. A demo and discussion can be found at Kai’s blog […]

Leave a Reply