HTML Rendering Engine as a Java Control - java

We have a client side application (Java/Swing) that we need an HTML rendering control for.
What I want to find is the most widely adopted, most heavily developed, easiest to deploy solution to get Gecko or WebKit into a Swing app (Needs to run OS X and Windows).
The limited (crappy?) JEditPane type solutions are not robust enough for our needs. We would really like to use either WebKit or Gecko.
Some libraries seems to exist that would allow this:
(QT WebKit) http://trac.webkit.org/wiki/QtWebKit
(JRex) [can not post URL because I am new]
etc.
Whats the best library to achieve this?

Doing a quick Google search tells me that there is a JWebPane in JavaFX.
Have a look here.

Related

D3js within Java application

What is the best way to embed a D3js visualization within a Java application?
Initial thoughts:
JWebPane (Vaporware)
Lobo browser (Still at HTML 4 and CSS 2)
DJ Native Swing Project (Inactive since 2011)
Other ideas?
There have been related SO questions (such as this), I'm looking for solutions specific to supporting D3js.
I am open to ideas that may not include a full blown web-browser integration, just the minimal set required for D3 visualization. I'm thinking this would include a Javascript interpreter, DOM manipulation, and an HTML/CSS layout engine such as WebKit.
I have used JavaFX and webengine for this. But I am really thinkig about porting d3 to Java ...
You could use SWT's browser component via SWT/AWT bridge
javafx-d3 - Provides a Java API to use the JavaScript library d3.js with the JavaFx WebView.
So far this seems to be the best option.
I just stumbled upon this d3js without testing it.
the best way i have seen till now that importing jxBrowser library and call your html...or what ever extension was to java application. Later, you play with the Jfram change the size you want and etc..

Embeddable Cross-Platform Web Browser?

I'm wondering if there is a Web Browser that I can embed in my Applications and that is cross-Platform (Windows, OS X, Linux)?
I'm undecided about the programming language, but I guess I'll have to go the C++ route (in which case I'd likely choose Qt as a GUI Framework) unless something for .net/mono or Java exists?
Doesn't need to be too fancy, but should ideally be free/open source. I know I could just grab the WebKit sources, but these are HUGE, and I wonder if they are really intended for embedding or if there is a browser that is already embeddable?
It does not have to be the latest and greatest, although Ogg Theora support would be excellent (or at least some way for me to add it)
I have found this Webkit based browser:
Arora
As #Andrey noted in his comment WebKit is itself embeddable. If you use Qt then you can easily embed it into your application using QtWebKit.
This is a java solution, but you might want to look at jdic.
https://jdic.dev.java.net/
Eclipse includes a web browser which you might be able to use. I have no experience with actually using it, but it works ok for webpages inside Eclipse.

I want to make a web browser, but I'm not sure where to start?

I want to use WebKit as the layout/rendering engine, and I want to code it in Java. I am having troubles finding any useful info. I saw this question here which cleared things for me slightly, but I need more to get started.
I would like to know:
If I can use Java?
Where can I find documentation on how to work with and use WebKit? ( I am looking for something like the Java API )
Is there a WebKit build compiled for Linux? ( Specifically Ubuntu/Debian )
My plan thus far:
Learn to use/interact with WebKit and its components specifically JavascriptCore.
Create the UI, etc. in Java and create a basic browser. ( For now, I want to create a basic window that can display a webpage correctly. )
Sorry if this isn't very clear. I am still hatching ideas, and I am not really sure what I want to find or need in order to move forward.
Edit: I just came across this question here. I want to do something like that; so I guess what I am wondering is how do I go about embedding an engine like this into an application that I make myself? I also forgot to mention that I am willing to do this in other languages. ( By this I mean C++ )
1: Yes, it's possible. A google search for "WebKit Java Browser" brings up several projects.
2: The best I could find in terms of documentation is the documentation section in the WebKit wiki.
3: Here's a guide to making a WebKit build on Linux using QT.
Hope for JWebPane to be released and go from there
You can try http://www.concord.org/~dmarkman/jws/webkit/ Alternatively if you are comfortable with Qt has a webbrowser control as well. Its quite easy with Qt, you just drag and drop the webbrowser control on the UI.
You can check out several examples of webkit control for Qt at (URl ommitted due to first time answer), just do a search for webkit Qt on google theres lots of examples on the Qt Website. cheers

How can a java library be ported to the web?

How do you take a java library that is for the desktop or an applet and make it so you can use its functions for a web page? I know not all things are meant for the web, but can you call a "regular" java class in an apache/tomcat setup server and it "work"? Do you have to so something to it to get it work with a web page?
I was interested in jgrapht for the web but it looks like all desktop or applet and I don't know that it would be possible to return its graphics to the browser, but maybe its libraries and a generated .png rendered by the browser.
Although there is debate on applets being alive or dead, I am not interested in using one at the moment, as it appears it is dead, albeit with new possible life in the latest update 6u10. I don't know that I want to invest in JavaFX either.
Johnny, the thing is that you have to decide what you mean to do. You could, for example, use JGraphT in server side code; the graph could be visualized in a bunch of different ways, like JGaph or graphviz. Then you would output the visualization in some form that works on the web and put it into your web page. In JGraph, that probably means a print interface that generates SVG or PNG.
Or you could emit the graph structure as JSON with a simple walk of the graph and interpret it on the fly in the browser using Javascript.
It's hard to answer the question generally, because it strongly depends on how you mean to use it.
Yes, it is possible to use a java class or jar file in a web appliaction, but it also depends on what you want to do with it.
For example if the library is for mathematics and you want to return results back to the users on a web based application, this is definitely possible. There are many other examples I can give but they are all the same.
As for displaying charts, I have successfully used JFreeChart in a web application using Apache Wicket (which rocks btw).
So to answer your question, you don't really need to "port" the library, you just need to use it and display it's output to a web page instead of a java desktop GUI.
Of course their might be some libraries that are specifically designed for Java GUI stuff like Swing or AWT. But for the most part there is no difference in using a Java library in a J2EE environment or a J2SE environment.
There isn't a closed-form answer to what you are suggesting: porting a Java Library to a browser's environment and using its functionality.
If you are interested in graphing things, here are a few things you can try:
Open Flash Chart - a scriptable flash app that will produce graphs
Bluff - a Javascript library that produces graphs
processing.js - a port of the excelling 'processing' library to Javascript
As for accessing Java-based functionality in the browser, there are some approaches for that. One is to use a toolset like GWT that complies java into an HTML/Javascript/Java application. Another is to use an AJAX-based technology like Direct Web Remoting. It really depends on what you are trying to accomplish.

Embedding Flash / Flex component into Java app

I'm working on some Flex spike in my company. We are basically evaluating different scenarios etc. What solution would you recommend for embedding Flex components into Java app? Flex <-> Java communication is not (yet...) an issue, just embedding swf into JFrame.
I've done it with EasyJCom. It's pretty straight forward as long as you're using one of the standard Java windowing libraries (Swing, awt). You can see an example (From the EZJCom site) here: http://www.ezjcom.com/FlashTest.java.txt
The people responsible for EasyJCom are also very responsive, and even though we ended up not using their product (Switching platforms), I'd recommend them.
I haven't used JFlashPlayer, but did take a look at the docs, it seems to be adequate as well. I think their license requires you to obfuscate your code. I thought it was a little odd, but maybe I mis-understood the license.
It gets quite a bit more complicated if you don't want to use Com, or if you need to embed in another type of window.
If you need to embed flash cross platform, you may be stuck rolling your own Jini library for the Mozilla plugin. At that point... Maybe it's worth just switching platforms if you aren't too far in. ;)
Haven't tested this, but it looks like JFlashPlayer will do the job. http://www.jpackages.com/jflashplayer/
None of these supports Linux or MacOS. So much for the cross-platform Java and Flash.
I think the best way to do something like this would be to embed something like xulrunner into your java app then have the java app interact with flash via the xulrunner interfaces.

Categories