DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Coding
  3. Frameworks
  4. Plugable Swing – A Hello World OSGi Example

Plugable Swing – A Hello World OSGi Example

Peter Karussell user avatar by
Peter Karussell
·
Sep. 17, 09 · Interview
Like (1)
Save
Tweet
Share
16.67K Views

Join the DZone community and get the full member experience.

Join For Free

there are a lot of osgi applications available, but a minority of them is aimed at the client side. here i will list some on swing:

  1. http://felix.apache.org/site/apache-felix-application-demonstration.html
  2. http://danielrohe.wordpress.com/2009/04/01/swing-application-on-osgi/
  3. http://www.toedter.com/blog/?p=33
  4. http://code.google.com/p/osgi-in-action/
  5. sip-communicator

today i tried the same and had luck. it was very fast (~1h) to get all working what i wanted, because i shamelessly stole the code from the example of apache felix. it is even more easier than this example but should have the same effect: it shows how one could use osgi even for a swing application.

there is a host application called swing on osgi – host with one jmenu which does not change (static) and one (dynamic) jmenu which could be changed from the available plugins (here only one: swing on osgi – plugintest ). the source code (apache license 2) can be checkout via

svn checkout https://timefinder.svn.sourceforge.net/svnroot/timefinder/branches/swingosgi swingosgi

… you will need maven. after ‘mvn install’ for both projects you will only need to start the host application via your ide or via

java -jar target/host-1.0.0.jar

then if you see the “dynamic menu” with one menu entry (which was added from the plugin) all is fine:

helloosgiworld

if you have problems while building this send me an email or comment here.

i got the plugins even working in my timetabling application timefinder which uses the client-side framework called spring rich client . the first plugin for spring rich client - read more .

from http://karussell.wordpress.com

application Host (Unix) code style Spring Framework Apache Maven Framework

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How To Best Use Java Records as DTOs in Spring Boot 3
  • Microservices 101: Transactional Outbox and Inbox
  • Fixing Bottlenecks in Your Microservices App Flows
  • Stress Testing Tutorial: Comprehensive Guide With Best Practices

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: