Rendering webpages with WebKit in Java - java

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

Related

How to locate elements on Java Swing Application for accessibility?

I'm trying to locate elements on my Java swing application window using Accessibility Insights for Windows. But, it is not identifying my own java swing windows application. However, it is working fine when I'm trying to locate elements on any other Windows App like, Calculator.
How do I inspect my own java swing application, just like any other Window App ?
Java Swing application is not like other Windows apps. Swing uses its own GUI controls and engine which runs completely within Java. To Windows, a Swing application seems like a single canvas in the size of a window; in other words it does not use any Windows API for controls like buttons, labels etc. This is why you are not seeing anything.
If you want to make your Java program accessible, you should follow the Java Accessibility Guide:
for Java 16 (PDF, dated 2021-03, latest version)
for Java 11 (PDF, dated 2020-12, LTS version)
for Java 8 (LTS version)
for Java 7

How to set UserAgent using WebEngine of JavaFX prior to JDK8?

I am using JDK7 for development and I want to set a user agent using JDK7 JavaFX Webengine.
Can anybody help me out with source code which sets the useragent using javaFX webengine using JDK7?
I have searched a lot but the only way is using JDK8 but I have to must use JDK7 to support Windows and MAC build.

Java GUI compatible with Mac and Windows

I have a project whose GUI was implemented in MAC notebook, when I tried to run it in Windows, there is different GUI and also different buttons' characters. I checked the type of all used fonts, and I am sure they are all installed in windows, Are there any other things I have to consider to work in both platforms ?
In swing there exists a LookAndFeel which by default is set to be platform specific: adapt to the normal platform theme. A nice cross-platform look-and-feel is nimbus.
What the fonts are concerned: look at this where registerFont is called.
You can Swing as the same code you develop will run on Mac, Windows or Linux.
You can install Windows Builder for eclipse. Tute is here:
https://www.youtube.com/watch?v=oeswfZz4IW0
(till 5:05 in the video)
A comprehensive guide to Swing and its various components can be found here: https://www.youtube.com/watch?v=rgkWfz7Vy40

Enabling Google Chrome Frame on DJ Native Swing

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.

Java: cross-platform .flv playback

I'm looking for a way to playback .flv files using java. This means I will need a ffmpeg lib that is cross-platform. I've been toying with jmf and fobs4jmf, but I cannot playback in linux because I need a native library (maybe fobs4jmf.so?).
Is there any java lib that allows me to playback .flv besides fobs4jmf? Or fobs4jmf can be used in linux, mac, etc? A pure-java lib would be perfect!
Edit: The player will be deployed as a java web start app (targetting jre6).
I'm probably not reading your question correctly, but I don't understand what you have against fobs4jmf. It seems to support Mac and Linux fine, see http://fobs.sourceforge.net/f4jmf_first.html
i would use a blatant shortcut. use an embedded browser and have it play the file using the browser's flash plugin.
http://www.eclipse.org/swt/snippets/#browser
heres how to embed a browser in your app, and just deliver it content through a really simple embedded web server. im sure you can just pickup a flash app that plays flv's no problem with the help of google.
you probably want a go with javafx in this: http://java.dzone.com/news/video-getting-started-with-jav
Xuggler works on Linux, Mac and Windows. I think it'll do the trick.

Categories