I have Google Chrome Frame installed on my Windows XP + IE8 machine.
When I navigate to chrome frame enabled page using IE8, it works.
But when I navigate to the site through a Java application that uses DJ Native Swing, the add-on is not activated.
The application uses SWT version 3.740.
Is it possible enable Chrome Frame in the DJ Native Swing browser?
Try imbedding WebKit layout engine with V8 JavaScript engine into Swing.
Getting Chrome Browser in java Applications
According to the documentation at JavaDoc: JWebBrowser it only supports IE and Mozilla:
A native web browser, using Internet Explorer or Mozilla on Windows, and Mozilla on other platforms.
However, according to the code it implements the "XULRunner Runtime" NSOption which according to The XULRunner Wikipedia article XULRunner appears in the credits for Chrome therefore it may suit your requirements to use Mozilla but it wont be Chrome.
The methods JWebBrowser.useWebkitRuntime() and JWebBrowser.useXULRunnerRuntime() seem to be the only built in options but you can use the NSOption class to define your own options if you know the correct variable names to pass.
I hope this helps
First, SWT control for Browser is what DJ Native Swing is using, but it also has all sorts of glue code to make it thread safe with Swing. Thus, changing to pure SWT would yield the same problems, plus threading issues to solve.
About Google Chrome Frame in SWT, and thus in DJ Native Swing, there is currently no support in SWT itself. See this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=317322
SWT, and DJ Native Swing, allow to create one's own ActiveX bridge. Maybe you could create your own component for Google Chrome Frame ActiveX on windows, similar to what DJ Native Swing does for the Windows Media Player component.
Last time in Swing project when we had to integrate browser into Swing application, we finally used Eclipse SWT component, that defaulted to IE. That made build for Windows only, but it worked, and eliminated some Swing bugs.
Try using Eclipse SWT control for browser.
Related
I have an internal web application and I want to be able to take a screenshot of the user's entire desktop environment through the app, not just the browser window. In my research, I've found that I could do this using a Java applet. However, Java applets are no longer supported in Chrome as of v45, and they tend to be slow and dated. I've explored the possibility of using flash or a browser extension, but it appears that I would only be able to capture the browser window through these means. I'd prefer not to use a native application, as the screen capture is to be a feature of the web app, so I'd like to keep them as tightly coupled as possible.
Specifically, are there any other methods that I am missing to achieve what I'd like to do? I've sort of resided myself to a java applet sans chrome support or a separate native app, but I've had trouble finding literature online about my use case (assumably due to the security concerns).
I am making an application in java which would be showing a HTML web page, getting the address of the webpage from a config file. The web page will be on the local disk. Now what i want is, when i start the Java program, the program will be showing the the webpage fullscreen on the computer without the mouse cursor. Now for that i would be first needing a HTML Engine or a web browser which can run inside the java application(events liek press of button etc etc will be passed to the web page from the java application). I cant find a way to show these web pages. I would be needing to show current tech web pages , such that it can process everything from jQuery, Js, Ajax, CSS3, HTML 5. So that beautiful web pages are able to be shown through the Java program.
JxBrowser is a good api for such purpose. It uses the chromium engine which offers an optimum speed just like native browsers. I have used it and it worked for me
Maybe you can give a try to jxbrowser
It promise to be a very good component.
From the home page:
Embed a lightweight Chromium-based Swing component into your Java
application to display modern web pages built with HTML5, CSS3,
JavaScript, Flash, Silverlight etc.
This is possible if you're willing to use javaFx.
I'm not sure to which extent the latest html5 and css3 goodies are supported, but it's a decent browser enough : java fx WebView component
You can try using the SWT Browser control if your application runs on Windows.
It wraps the currently installed Internet Explorer and gives you a very powerful access to its functionality including event listeners, etc.
I am looking for an open source browser component like the ones in DJ Project (http://djproject.sourceforge.net/ns/index.html) for SWING. I tried using DJ Project (which I learned about from Best Java/Swing browser component?), but I noticed that it hasn't been updated in recent months.
If there is an easy way to make a web browser using JInternalFrame, that would be awesome as well.
Thank you in advance!
Is it possible to render webpages with WebKit through a Java application?
P.S.
I want it to be compatible with Windows, Linux and Mac Os X.
Qt WebKit with Qt Jambi. Supports Windows, Linux and Mac.
In JavaFX is included in Java 7. This contains WebView which is based on WebKit.
http://docs.oracle.com/javafx/2/webview/jfxpub-webview.htm
WebKit via SWT
Also see
Previously answered question
and
jxBrowser
I have seen a lot of people try to make a web ui looks like a desktop ui. However, most of the time i feel web ui is much more interesting than the desktop ui, with the help of javascript toolkit like jquery, gwt-ext etc.
My question is, how to port the web ui to desktop ui? Do I need to embed a javascript engine in java? css engine? html layout engine? That sounds like a lot of work to do.
Any easy way of doing this?
you can embed a web server in your app and you can embed a browser inside your app window. i know eclipse does this pretty well. it uses SWT to do the heavy lifting
http://www.eclipse.org/swt/snippets/#browser
check the Browser section
your web server doesnt even have to be a proper web server, it just has to set the content, and can query / change it on the fly. the javascript on the page can even interact directly with your app.
you should be even able to use crazy web frameworks like
http://echo.nextapp.com/site/
or
http://code.google.com/webtoolkit/
or even run a ruby site through JRUBY
or make really complex apps using the new HTML5 engine [canvas/video tags] (if your client has the new mozilla installed)
Adobe AIR technology solves this exact problem. The code you develop using Flex can be rendered in the Flash player plugin of a browser or the same code can be easily packaged as a Desktop application that runs on the AIR runtime.
Have you seen Appcelerator's Titanium Desktop
This is one of the best solution for you (i think!)
You write the javascript and html code, and the titanium SDK creates the Desktop application of the same
There is support for Python and Ruby.
Must try :
http://www.appcelerator.com/products/titanium-desktop/
if you are a Ruby programmer then you must also see this
http://www.rubyinside.com/bowline-rails-for-the-desktop-2183.html
Prism from Mozilla is made for this goal, exactly. It's out of beta now too, I believe.
Check Google Gears y Adobe AIR
It not 'a lot of work to do', it's a huge amount of work to do - you would in effect be writing you own browser and it'd never come close to the poplar ones out there, simply because you wouldn't get the level of feedback something like Firefox gets.
If you're trying to avoid address bars, menu bars, etc these can be switched off in all the popular browsers and so to the user the appearance would be that it's more application like with only the rich content of the HTML visible.
Sounds like JavaFX would be good for you?
http://en.wikipedia.org/wiki/Javafx
Try XULRunner from Mozilla. If you have developed extensions for Firefox, then this is the exact same thing. XULRunner contains the Gecko engine, so it can render XUL and HTML with CSS, and it supports JavaScript with many useful XUL Components, like file read and write, directory browser and network tools.
Because it supports HTML you can in effect make a webpage and have it run like an application. Also it is cross platform, so it will run on Windows, Mac and Linux, anywhere Firefox runs actually.
There is some information on creating XULRunner applications on the net, but since it's so similar to making Firefox Extensions, you can just google for that. A good Tutorial for getting started is this one.