Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is JavaFx better than Swing?

48 views
Skip to first unread message

slawek

unread,
Aug 4, 2020, 8:59:41 AM8/4/20
to

Is JavaFx better (i.e. simpler, cleaner, more easy, more
productive) than Swing?

Where is ready-to-use SDK with ver > x.x.2 ?

BTW, Gluon offers only "trial demo" (up to 2 patches, alike Oracle
JDK mambo-jambo with free-but-monetized licensing
scheme).


----Android NewsGroup Reader----
http://usenet.sinaapp.com/

Jeffrey H. Coffield

unread,
Aug 5, 2020, 12:22:38 PM8/5/20
to


On 08/04/2020 05:59 AM, slawek wrote:
>
> Is JavaFx better (i.e. simpler, cleaner, more easy, more
> productive) than Swing?
>
> Where is ready-to-use SDK with ver > x.x.2 ?
>
> BTW, Gluon offers only "trial demo" (up to 2 patches, alike Oracle
> JDK mambo-jambo with free-but-monetized licensing
> scheme).
>

JavaFX is far superior to Swing because of all the experience* the
developers of Swing gained. In particular, JavaFX has built in
properties where Swing had many attempts at "beans-binding" that never
completely worked.

You will want to get SceneBuilder to edit fxml files and start with a
JavaFX FXML application.

Java 8 included FX support but after that you have to download a
separate jar and also contend with the "new features**" of Maven or Gradle.

Jeff

*(Good judgement comes from experience, experience comes from bad-judgement)

**(Oh crap! They figured out how to use the software. Time for a rewrite.)

slawek

unread,
Aug 6, 2020, 2:15:08 PM8/6/20
to
"Jeffrey H. Coffield" <jef...@digitalsynergyinc.com> Wrote in message:
> Java 8 included FX support but after that you have to download a separate jar and also contend with the "new features**" of Maven or Gradle.

I have summarize my "research".

1. It is not possible use Ant. I must use a mambo-jambo (a new
language for Gradle, new tools and mabye sign in to some
repos/services) AND again learn n-th time how to write "Hello
world" (no more EDT, a rather stupid assumption that the app ==
window, dozen objects before a single window will be created, no
chance to migrate with existing code).

2. Apache Netbeans+JDK8+JavaFx - no fun - the Fx examples does not
work at all.

3. There is no good tutorials on JavaFx. Most tutorials is on old
versions like 9.

4. The vendor lock - the only free avaliable versions are buggy -
for example 11.0.2 is buggy, the updated 11.x.x are non-free (no
avaliable compiled libs).

5. And last but also important - there is exactly one entusiast of
JavaFx - You. Nobody else answered on pros Fx.

Actually Swing is rather... mature... old... maybe obsolete. But
usefull. Java Fx is like BR discs - superior but useless. (Yep, I
have a BR drives/recorders etc. But - with the 8K, fibers,
terabyte pendrives - I don't use Bluray anymore.)

Daniele Futtorovic

unread,
Aug 6, 2020, 7:42:27 PM8/6/20
to
I did a lot of Swing back in the days. I did a little bit of JavaFX
recently. I would lean towards recommending the latter over the former,
for the reasons Jeff mentioned, and for some he didn't -- notably the
CSS support, i.e. the separation of model and presentation, which is a
huge improvement IMHO. The beans binding are really neat, too, if a bit
tricky to get the hang of and clunky in tight corners.

Note that you don't have to do your scenes in XML. POJC works, too.

> 1. It is not possible use Ant

So don't. It's an outdated tool. I don't like Gradle either, but Maven
is mature and powerful. At any rate, dependency management is its own
can of worms, and not limited to Swing.

> no more EDT

Really?
<https://docs.oracle.com/javafx/2/architecture/jfxpub-architecture.htm>

> no chance to migrate with existing code

True. For better or for worse.

> There is no good tutorials on JavaFx.

Not even here: <https://openjfx.io/openjfx-docs>?

> And last but also important - there is exactly one entusiast of
> JavaFx - You. Nobody else answered on pros Fx.

Nobody else answered until I did now, period. Would you rather you had
gotten zero answers? Why did you ask then?

> Actually Swing is rather... mature... old... maybe obsolete. But
> usefull

Swing is solid and if you know it well (and you *have* to know it well
in order to be proficient with it), then it's a good choice.

But it most certainly is the past. For any newly created UI that you
expect to have a meaningful lifetime, JavaFX is very likely the better
choice.

--
DF.

slawek

unread,
Aug 7, 2020, 4:52:56 AM8/7/20
to
Daniele Futtorovic <da.fut...@laposte-dot-net.invalid> Wrote in
message:
> Not even here: <https://openjfx.io/openjfx-docs>?

Yes. Not even there. (Docs is for docs - but I look for a simple
tutorial - not for over 1000 pages with details "how cast shadows
in 4D animations". I want learn fx in ONE WEEKEND - a form with
widgets, how to draw line, circle, write text or make xy plots.
And - most important - how to setup tools and project.

There are many resources... but about 50% outdated and 50% useless.


> Nobody else answered until I did now, period.

2 person in about a week. Really a big number!

> Swing is solid and if you know it well (and you *have* to know it wellin order to be proficient with it),

Swing is easy. But more important is that I can separate Swing
calls in subclasses. I can replace Swing subclasses with SWT
subclasses or AWT subclasses - because program architecture
depends on an abstract toolkit. JavaFx seems to be rather a
framework than a toolkit. It force the program architecture like
MFC and OWL do. Actually it may be hard to apply more
sophisticate concepts - because fx is about nice and colourful
but Delphi-like apps. You must create stage, scene, window - you
have no choice. I can start Swing GUI on demand, close GUI,
reopen with SWT or as TUI - without any problems.

> But it most certainly is the past. For any newly created UI that youexpect to have a meaningful lifetime, JavaFX is very likely the betterchoice.-- DF.

I doubt. The Java for desktop apps is passe. Mostly due to Oracle
decisions. The Swing is old, Fx is oversophisticated and too
complicated. There is no real good choice.

Daniele Futtorovic

unread,
Aug 7, 2020, 8:48:00 PM8/7/20
to
On 2020-08-07 10:52, slawek wrote:
> The Java for desktop apps is passe. Mostly due to Oracle
> decisions. The Swing is old, Fx is oversophisticated and too
> complicated. There is no real good choice.

Well, looks like you found an answer to your question. Good on you!

--
DF.

Jeffrey H. Coffield

unread,
Aug 8, 2020, 12:43:04 PM8/8/20
to
I would agree that there is no good choice, but we have to work with
what is available and for now, we are more productive using FX instead
of Swing. If you find a better solution, I'm all ears.

Best of luck,
Jeff
www.digitalsynergyinc.com

slawek

unread,
Aug 11, 2020, 4:01:14 AM8/11/20
to
Daniele Futtorovic <da.fut...@laposte-dot-net.invalid> Wrote in
message:
> On 2020-08-07 10:52, slawek wrote:> The Java for desktop apps is passe. Mostly due to Oracle> decisions. The Swing is old, Fx is oversophisticated and too> complicated. There is no real good choice.Well, looks like you found an answer to your question. Good on you!-- DF



Why was I asking for JavaFx? It's simple. I have my own view on
this matter. But it is reasonable to get to know other people's
opinions. Because better decisions can be made that way. And I
even can learn something. I expected a rather affirmative
enumeration of the advantages supported by quantitative data
like: twice as fast, 20% shorter, that etc. None of this. The
black scenario has been confirmed - Java is deadend.

slawek

unread,
Aug 11, 2020, 4:13:26 AM8/11/20
to
"Jeffrey H. Coffield" <jef...@digitalsynergyinc.com> Wrote in message:
> I agree that there is no good choice, but we have to work with what is available and for now, we are more productive using FX instead of Swing. If you find a better solution, I'm all ears.

No, I have not. I am not FORCED to use Java. I may freely choose a
language/languages to my projects. Java was best choice in 2010.
Java is not - just for me - best choice in 2020. It is a little
sad.

Daniele Futtorovic

unread,
Aug 11, 2020, 6:33:57 AM8/11/20
to
On 2020-08-11 10:00, slawek wrote:
> Why was I asking for JavaFx? It's simple. I have my own view on
> this matter. But it is reasonable to get to know other people's
> opinions. Because better decisions can be made that way. And I
> even can learn something. I expected a rather affirmative
> enumeration of the advantages supported by quantitative data
> like: twice as fast, 20% shorter, that etc. None of this. The
> black scenario has been confirmed - Java is deadend.

I might be able to get you that analysis. How much are you paying? :D

More seriously though, try Reddit or something like that. In case you
haven't noticed, it's Usenet that is pretty much, if not a dead, then a
not-at-all-well end these days.

As for Java, I don't think it's dead or close to dying. Not even for
UIs, although arguably in that respect it's unlikely to flourish either.

But I for one do foresee that, with the introduction of Project Loom,
Java will actually reassert its dominance as a language for the next decade.

YMMV.

--
DF.

Jeffrey H. Coffield

unread,
Aug 15, 2020, 12:26:49 PM8/15/20
to
If you are still interested in Java, I found this yesterday, loaded on a
Raspberry PI 2 and ran a full JavaFX program developed under Java 8 with
no special setup after the installation. I have done no other testing
than this but it looks promising.

https://bell-sw.com/pages/downloads/

It was based on this article:

https://medium.com/javarevisited/installing-java-and-javafx-on-the-raspberry-pi-d68d0ad7b484

Jeff

slawek

unread,
Aug 20, 2020, 8:37:20 AM8/20/20
to
"Jeffrey H. Coffield" <jef...@digitalsynergyinc.com> Wrote in message:
> I found this yesterday, loaded on a Raspberry PI 2 and ran a full JavaFX program developed under Java 8 with no special setup after the installation.

Nice. My app, C (without ++) and Win API, for Windows 95 run
flawlessly under Windows 10 (and 8.1, 7, Vista, XP) and also
Linux (Wine). Rasbian is Linux. Therefore it should works even on
Raspberry (Zero?).

Anyway I suppose that Swing has no problem on Raspberry.

The problem may be with license, RP may be treated as an
non-general computing env. OpenJDK don't have JavaFx. Classical
FUD. And - THIS IS THE MAIN TROUBLE - only beta versions (x.0,
x.1, x.2) are free and public - patched bugfree JavaFx versions
are behind a paywall. The real pain is that nobody can use
unpatched libs and honestly declare best practices.

Even more. Raspberry is really fun and exciting. But you have no
chance to produce/sell anything with Raspberry embeded. You can't
use it for example to produce 1000000 inteligent door bells...
Also BT in Raspberry (Raspberry as a part) is without - AFAK - a
valid SIG license: Raspberry is conformant, but your product need
separate SIG license anyway. It has no effect for hobbysts or
during R&D. But it is very important for any commercial use (like
door bells mass production).

Graeme Geldenhuys

unread,
Oct 22, 2020, 4:09:27 PM10/22/20
to
On 05/08/2020 5:22 pm, Jeffrey H. Coffield wrote:
> Java 8 included FX support but after that you have to download a
> separate jar and also contend with the "new features**" of Maven or Gradle.

This is the part that puts me off from using JavaFX... It's not
standard with JRE any more. Also not all platform are equal
when comes to JavaFX. eg for a long time there simply wasn't
support for JavaFX under FreeBSD - my development system and
daily desktop system. These days its not a problem, but then
you also have the issue of what 3D driver do users have
installed.

Just too many barriers - limiting who can run you application
reliably. When it comes to Swing, *everybody* can run your
applications exactly as you indented for them too. No barriers
for the end-user.

I guess this is why you don't really see many JavaFX based
applications in the wild, yet there are millions of Swing
apps (old and new).

So yeah, they might have improved the API of JavaFX, but they
sure didn't improve deployment and ease of usage of apps
built with it.

Regards,
Graeme

Graeme Geldenhuys

unread,
Oct 22, 2020, 4:46:50 PM10/22/20
to
On 22/10/2020 9:09 pm, Graeme Geldenhuys wrote:
> Just too many barriers - limiting who can run you application
> reliably. When it comes to Swing, *everybody* can run your
> applications exactly as you indented for them too. No barriers
> for the end-user.

Oh, and then there is also the matter of size (yes, I'm old school and
application size is still something that bugs me). I followed the
JavaFX samples and created a Hello World fat jar using Maven from the
CLI. On my Linux system that resulted in a 8.25MB jar file.

Created the exact same Hello World application using Swing, and
it resulted in a 1286 byte class file.

Wow! :-)

Examining the jar from the JavaFX version, it seems it will also only
run on Linux, because it included Linux native *.so files for GTK2
and GTK3, and some font handling FreeType library. So I would have to
compile separate jars for each platform, or try and figure out how
to build a true "fat jar" for all platforms. :-( The fact that now
my Java application will only run on Linux completely goes against
what attracted me to Java in the first place.

Compile once, Run everywhere!


So I'll stick with Swing for as long as I possibly can.


Regards,
Graeme



Graeme Geldenhuys

unread,
Oct 22, 2020, 5:10:27 PM10/22/20
to
On 11/08/2020 11:33 am, Daniele Futtorovic wrote:
> As for Java, I don't think it's dead or close to dying. Not even for
> UIs, although arguably in that respect it's unlikely to flourish either.

Java GUI apps are flourishing pretty well in the most popular mobile
platform it the world.... Android. ;-)


G.

slawek

unread,
Oct 26, 2020, 2:40:01 AM10/26/20
to
Graeme Geldenhuys <gra...@example.net> Wrote in message:
> On 11/08/2020 11:33 am, Daniele Futtorovic wrote:> As for Java, I don't think it's dead or close to dying. Not even for> UIs, although arguably in that respect it's unlikely to flourish either.Java GUI apps are flourishing pretty well in the most popular mobileplatform it the world.... Android. ;-)G.

Java but not Swing. Swing is useless on Android.
--

James Shisia

unread,
Aug 23, 2022, 8:48:42 AM8/23/22
to
A lot of people will say this is bad, oh, that is bad and many other stroies. Fact is, the more experienced you are with Javafx the more you will produce excellent and efficient application GUIs. I'd say it's not for "Hello World" programmers, if at all that term exists and with all due respect. It just lies on the principle of practising one kick 1000 times and practising 1000 kicks once. Which is more lethal?
0 new messages