[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.equinox] Re: Integrating Swing apps on top of Equinox

Hi Eva!

In addition to the described solution there might be another one (also not related to OSGi, Equinox, etc. at all). If you have control over the two apps, you might think about using a special look and feel that allows you to control the look&feel on a per-window base. Then you can easily run l&f A for one app and l&f B for the other one while both are running on top of standard swing:

https://substance.dev.java.net/

Maybe this helps...

Cheers,
-Martin



Eva Troels wrote:
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!