Is JavaFX a replacement for Java Applets? - java

Is JavaFX technology for building rich internet applications (RIA) a direct replacement for Java Applets?

No, JavaFX is not a replacement for applets. In fact, the idea is that you write applets that use JavaFX to things like what you can do with Adobe Flash or Microsoft Silverlight.
So rather than replace applets, it's expected that JavaFX might make applets popular again.
edit (08/15/2019) my answer above is 10 years old - things have changed. Applets are not supported anymore; Oracle does not provide a Java browser plug-in that can run applets with current versions of Java. Don't write code that uses applets anymore.

Related

Java browser that support applet

Is there's any java embedded web browser(free) that support applet running ?
I don't mind if its use some native libraries.
Currently ,I already tried javafx web view and DJnativeswing and they dont detect java(doesn't support applet).
Most of the modern browsers (Chrome v42+, Firefox 64 for Windows, Microsoft Edge, etc) have dropped support for NPAPI which is required for applets to run. Oracle is recommending that developers switch over to Java Web Start instead of using applet as the technology is fading. If you still need to use applets (eg. for school programming projects) you may need to uninstall your current browser(s) and install a legacy browser that still includes NPAPI.
Browser do not support applets nativly. That's because applets need a java runtime environment and an browser adapter to display the content in the browser. But if you install a jre it always will install an plugin into you browser(s) if not already present.

Can Java Web Start application work inside browser window?

This is the question: can JWS app occupy requin on web page or represent entire web page and/or access browser state parameters?
A Java Web Start application runs independently of the browser. If you want a Java app to interact with the hosting browser, you have to make it an applet.
See the last link in the applet info. page.
JNLP Support in the Next Generation Java Plug-In Technology (introduced in Java SE 6 update 10) goes into further details of the new abilities of applets.
I high-lit the version since it is a recent ability, and I got the impression you wanted to support older browser/JRE combos. from your earlier question.
That page expands..
The next-generation Java Plug-In technology (hereafter the "Java Plug-In") provides support for launching applets directly from JNLP files. Previously, only Java Web Start utilized JNLP files, for the purpose of launching Java applications. Now Java applets can be described using the same meta-descriptor.
Also note that launching an embedded applet using JWS does not solve any of the problems that inherently come with embedding a rich client GUI into the lighter HTML GUI.
Focus problems between HTML elements and the applet or applets. Sun never bothered to try and define what should happen, which resulted in either the applet or HTML getting focus, and that was it (as far as the keyboard went).
Then there is the matter of the PLAF of the applet which mimics, but never quite matches that of the elements used for HTML forms. Especially if they are styled, and that brings me to..
Applets do not respond to CSS! Perhaps intuitively obvious to applet developers, but no end of frustration to the site designer.
Typically there is at least one version of one browser that cannot load the simplest of applets correctly. My 'favorite' of all these type of bugs was a FF version that reloaded applets if the user scrolled 'up'. I could go on, and on, and on..

JavaFX 2.x in desktop development?

I have to find technology for new desktop application on Java only.
I don't want use swing, but I can't find good and perspective alternatives.
I know about JavaFX, but I have strong requirements: It must look good, not roughly on linux, windows and macOx. Does JavaFX work fine on each of this platforms? And which a big troubles can I find in using JavaFX?
I'm using FX in desktop development. It's great, but far away from being perfect. Also there's no Linux version at this moment, as for Mac, it's only beta 2.1 (which i'm using right now). The biggest thing that annoys me is freezes. U can download visual editor right here
BTW Gosling belives that FX would become more usefull in desktop dev than in RIA development
Eclipse's SWT should definitely be considered. It supports all three platforms mentioned and IMO is nicer to use than Swing.

Java integrated or embedded browser

I need a integrated or embedded java browser. I used WebEngine of javafx which support basic css as well html & java script but could not able to run flash file. Any way to do so.
Or any other Project u know which could fulfill my requirement.
You can also look at JxBrowser Java library that allows embedding Chromium-based web browser control into Java AWT/Swing application.
It supports both Java Swing and JavaFX.
BTW: the browser control is totally lightweight. All rendering happens in a separate native process by native Chromium engine. The web page looks like it's displayed in Google Chrome.
Check those (although they are not JavaFX but I suppose that they can be used):
http://lobobrowser.org/java-browser.jsp - pure Java
http://www.javadesktop.org/articles/jdic/index.html - better imho, but no longer maintained

Canonical way to include an applet

What is the canonical way to include the Applet?
I have tried,
Switch on Browsers in JS.
http://download.oracle.com/javase/1.5.0/docs/guide/plugin/developer_guide/using_tags.html#javascript
This breaks in Safari 5.0.1 on Leopard. (It worked on Safari on Snow leopard.)
Since we are not supporting old brosers, I assumed I could just use <object> tag, but apparently FF wont respect that.
What is the canonical way to do this?
The applet tag seems like a reasonable compromise, but I've migrated almost entirely to Java Web Start.
Addendum: A passerby notes,
JWS is a technology for launching desktop apps.
From the Java SE 6u10 release notes: "The next-generation Java Plug-In technology…provides support for launching applets directly from JNLP files."

Categories

Resources