Hi everyone,
We have two old, crusty Swing apps that we want to integrate on top of
Equinox.
There are several reasons for this decision the most important ones being:
- No clashing third party libraries (the two apps run different versions
of xerces, velocity, and several other open source products)
- Dynamic updates (the apps can be updated independently of each other)
I am fairly new to OSGi and Equinox and have experienced my share of
ClassNotFound and Class Cast Exceptions over the last few weeks.
Now, the two apps run and all is good. Almost. We had to do a few
workarounds. The one bothering me the most is the fact that we had to
change the applications' Look and Feel:
The applications both have Swing GUIs. This is easy: Just let the two
bundles import javax.swing and start popping up the JFrames.
But...The two apps have different look and feels. And these are setup
with calls to static methods in Swing. So the result depends on the
launch order. If app A wins the look and feel tug of war, the two
applications run albeit application B looks a bit different than usual.
If app B gets its way app A craches.
How to avoid this and let the two applications have each their look and
feel - isolation with regards to Swing packages.
My one solution is: Extract Swing classes for Java's rt.jar and create
two new bundles:
- SwingBundleWithAppALookAndFeel
- SwingBundleWithAppBLookAndFeel
and then setup the bundle interdependencies accordingly.
This, however, feels like a major hack and I'm not even sure, that it
works.
Please feel free to share any comments!