[jsword-devel] HTML Browser for BibleDesktop

DM Smith dmsmith555 at yahoo.com
Thu Mar 13 07:37:25 MST 2008


Jon Brisbin wrote:
> Is WebKit not embeddable in Java? It runs on all major platforms that  
> BD runs on...
>   
As far as I have been able to find out, it is not available except on Mac.

For it to work there are dynamic libraries that Java has to load with 
JNI (Java to Native Interface). So one would need to write bridging code 
with OS adaptive JNI loading.

The second part is that the bridging code needs to work in a Swing 
context for BD to be able to use it. It is likely that the WebKit 
browser is a "heavy weight" (in AWT speak).

Also, BD needs to be able to intercept links  and handle them. Such as, 
dict://strongs/h3068 to open the Strong's Hebrew and find and show that 
entry.

Here are my findings regarding WebKit:
With RCP/SWT/JFace (the Eclipse platform) it is used on Mac, but IE on 
Win and Mozilla elsewhere. Same also with JDIC.
http://www.concord.org/~dmarkman/jws/webkit/ but it is Mac only, very 
old and did not work on my Leopard machine. I am under the impression 
that this uses Apple's Cocoa to Java bridge which is no longer supported 
by Apple.
http://sourceforge.net/projects/webkitjava/ Again, Mac only and it is 
not Swing friendly.

However, this has been done with MozSwing, and some others, for the 
mozilla engine.

I guess one could follow MozSwing as a pattern and do the same for 
WebKit. But, I'm not inclined to do it.

My issue with any of these that use JNI: BD can run on any platform that 
Java 1.4.2 runs. With JNI, we would be limited to those for which we 
have the native libraries.

-- DM

> On Mar 12, 2008, at 5:15 PM, DM Smith wrote:
>
>   
>> In BibleDesktop we use a JTexPane to display HTML. So we have looked
>> at various options over the years. Perhaps the most comprehensive look
>> was by Joe Walker in 2004:
>> see: http://www.crosswire.org/pipermail/jsword-devel/2004-March/000689.html
>> In this post Joe mentioned:
>> JTextPane, JRex, Jazilla, JXWB, IceBrowser, SWT and a few others.
>>
>> JTextPane under Java 1.5 is still lame.
>> JRex's latest release was 1/2006 and does not work under Windows.
>> Jazilla is dead.
>> JXWB is dead.
>> IceBrowser not "open"  nor free.
>> SWT is excellent but would require a re-write of our current code  
>> base.
>>
>> Since then there are a few more: Lobo, JDIC and MozSwing.
>> FlyingSaucer https://xhtmlrenderer.dev.java.net/
>> MozSwing http://sourceforge.net/projects/mozswing and demo at http://jnlp.concord.org/dev/mozswing/mozswing.jnlp
>>  (big download)
>> JDIC https://jdic.dev.java.net/
>> Lobo http://lobobrowser.org/java-browser.jsp
>>
>> JDIC, looks to be nearly dead and has huge memory leaks. The others
>> look somewhat promising. Though Lobo doesn't look like it fits with
>> Swing (which we use) but rather AWT (which we don't).
>>
>> An interesting site regarding embedding mozilla (aka XUL) : http://xul.sourceforge.net
>>
>> Our current plan is to use SWT. But I hope to look into these some
>> more to see if they integrate well into what we have now.
>>
>> Any others?
>>
>> DM
>>     




More information about the jsword-devel mailing list