If you need to embed a web browser into a Java Swing application on Windows, you have many options, of which I have found the most useful is JDICplus, or JDIC itself. Both of these approaches are very well documented with excellent sample code.
However, doing this in a Linux environment is a little more complicated. I succeeded using no commercial software. There may be much better methods, but this is what worked for me.
I was initially able to get the package up and running using Mozswing. There is currently next to no documentation, but looking at the provided sample code helps a great deal. It uses the Xulrunner application from Mozilla to embed the browser. I did experience some instability (probably due to their Java/GTK libraries) under certain conditions, but they were easy to spot. The issues seem to be present if the Java application uses a large number of JNI calls. If you experience instability, I recommend using JDIC as discussed below.
Pros:
- Embeds a browser as a JPanel, fully compatible with the rest of the Swing application
- Tri-Licensed (GPL, LPGL, Mozilla), so it can be used in all the same situations as Mozilla.
- Uses an up-to-date version of Xulrunner
- Early in development, currently at Beta 1 release
- Some instability issues with Java applications that make heavy use of JNI
- Many JAR and SO libraries
Pros:
- Very stable
- Licensed as LGPL, not GPL
- Very little JAR and SO baggage to distribute
- Only works correctly with old version of Mozilla.
- Embeds as an AWT component, which could cause problems in some Swing applications.
