• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Are There Any Relevant JavaFX Deployment Tutorials For 2021?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm am so close to just throwing in the towel and switching to another language for creating cross-platform GUI desktop applications.

I just recently came from VB.NET (don't laugh, it worked!) and made the switch to Java because it was giving off the impression that building cross-platform GUI applications wouldn't require such a major learning curve or was to be a much easier process than many have made it seem.

I was so close to settling on with JavaFX after about 1 month of becoming content with and excited about the Java language, I finally tried to package up a very simple 1-button 'Hello, world!' application a few days ago, only to realize that it wasn't an 'easy process' after al.....In fact, it has been nothing but PROBLEMS!

I've been going on for days trying to find a simple solution, only to find out that most of these tutorials that I've been following were outdated and even deprecated.

Then I found in many online forums, folks are claiming that "JavaFX is DEAD"???

Anyhow, I apologize about this long, drawn-out, and even downright monotonous story that I've conjured for you. I'm just trying to see if anyone has a simple step-by-step solution that I can do in either Eclipse or IntelliJ Idea.....HELL, even the command line would be fine with me! I'm very eager to learn this.

If I can't find a solution soon, I'll have to switch to Electron or possibly Python with PyQT5. Please let me know before I just hang up the ol gloves. Thanks in advance if you can offer any support!

UPDATED:
I apologize, but I've already tried the default exporting in both Eclipse & IntelliJ Idea, and touched a little on Maven, but Maven requires a learning curve. If anyone has a good little example I can follow, I would appreciate it.

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aaron --

  I struggled with FX pretty much from the time it came out many years ago.

  The absolute BEST resource for doing FX is:  Sharan, K.  Learn JavaFX 8.   For the last 6 years it is has been my FX bible.  Very clear, very useful, very authoritative.
 
  If you are new to Java, Liang, Y. D.  Introduction to Java: Programming and Data Structures (Comprehensive version) is my go to resource.

  Good luck!

  -- Chris  (COlsen@mchsi.com)

  P.S.  I am working on a relatively massive project with lots of FX.  You are welcome to the source code (it is freeware) -- lots of FX that you might use as examples of code.   I use NetBeans and Maven, but it shouldn't matter.  The code has lots of mathy stuff that can be easily ignored.
 
Saloon Keeper
Posts: 12728
277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aaron, in your other topic I posted an example of how to get JavaFX running using Maven. Once you have set it up, you don't have to look at Maven again unless you want to change something about the build process, and you can learn Maven when it suits you.

I wouldn't say JavaFX is dead. It WAS dead for a short while because there wasn't a party that was willing to maintain JavaFX. Since then various updates came out. Most online forums are just parroting what they heard once.

It's true that there's probably not a good single source for a modern JavaFX tutorial. I suggest you scrape by with what you can find, and post your code here for review. That way you will get up-to-date advice.

I think the frustration mostly comes from GUI coding being difficult in the first place, especially if you've only experienced the underlying infrastructure for only a month. You rushed into JavaFX without really getting familiar with the language and build tools. I'm not saying you shouldn't have, sometimes that's how we do new stuff. But it's important to realize it's not the ideal path.

We're here if you need help. And if you just need to vent, that's okay too.
 
Marshal
Posts: 26383
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it makes you feel any better: getting your Java application to run on somebody else's computer has always been a huge pain. It's easy enough to write the Java app to run on your computer. But to run it on somebody else's computer, you have to ensure that they have a JRE installed there. And you have to ensure it's the right level; maybe you used Java 11 and they only have Java 8. And once you've got your application and the right version of Java, you have to make sure that the "somebody else" can find your application.

Yes, Java is Write Once Run Anywhere. But it's certainly not Write Once Install Anywhere. For Windows, for example, you either need to produce a Windows installer or else you need to write a page of instructions on how to get the Java environment configured correctly and how to create a suitable shortcut on the desktop, hoping the recipient can understand the instructions and execute them correctly. And no doubt other target operating systems have similar issues, although I'm only familiar with the Windows variety.

Oracle's solution to that was JNLP: you'd put your application on your web site and set up a configuration file (also on the web site) which allowed the consumer to download the application and, if necessary, install a suitable JRE at the same time. I used this a lot at work and it worked very well, at least with Windows. But that all died when applets were (rightfully) thrown overboard and now you're back to square one.

Bear in mind that I haven't had to wade into that swamp for several years now, so what I just wrote should be read in the past tense. In particular Maven is something I haven't worked with. So hopefully you can get it to produce a full package of JRE plus application which can be simply copied to another computer -- check it out.
 
Aaron Esteban
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Chris, and thank you so much for the resources!

So, just to clarify, I don't believe that I need learning resources on how java works or how to use JavaFX, I am already familiar with how to create GUIs and get them running in the IDE.
I've even gotten as far as multithreading with some jSoup and RegEx.

The only real aspect that I'm trying to focus on now, is how to compile/package my jar files up into a 'FAT JAR' file using either Eclipse or IntelliJ with Maven. I even understand a bit of how a POM file is to be structured and used.
The problem that I'm having is the file/directory structure of how the files (classes & .fxml) are to be placed and where exactly, inside of the Eclipse "Package Explorer" area after a Maven project has already been created.

I just need someone to show me a simple example of how the project folders & files should be placed prior to exporting to a 'fat jar' file.

Does either of your recommended books contain such content.....or.....do you happen to have a quick demonstration you can post here? I'd like to see an image of your file/directory structure inside of Eclipse (preferably), even though I know that you're using Netbeans. Please let me know if you can get around to do a quick setup. I'd greatly appreciate it.

Oh, and here is what my file/path/directory structure looks like at this point after starting a new Maven project in Eclipse:




Am I supposed to start out with a NEW "Maven project" and build off of that, or am I supposed to start with a NEW "JavaFX project" and later convert it to a Maven project? Which way is best?

Then how do I set up my files?

What is step #1, step #2, step #3, etc., etc.?





Chris R Olsen wrote:Aaron --

  I struggled with FX pretty much from the time it came out many years ago.

  The absolute BEST resource for doing FX is:  Sharan, K.  Learn JavaFX 8.   For the last 6 years it is has been my FX bible.  Very clear, very useful, very authoritative.
 
  If you are new to Java, Liang, Y. D.  Introduction to Java: Programming and Data Structures (Comprehensive version) is my go to resource.

  Good luck!

  -- Chris  (COlsen@mchsi.com)

  P.S.  I am working on a relatively massive project with lots of FX.  You are welcome to the source code (it is freeware) -- lots of FX that you might use as examples of code.   I use NetBeans and Maven, but it shouldn't matter.  The code has lots of mathy stuff that can be easily ignored.

 
Aaron Esteban
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks again Stephan! Yeah, I looked at your POM and got the overall idea of how the project will include the dependencies, but I still need someone to guide me on the file and folder structure inside of the "Package Directory" inside of Eclipse after starting a new Maven project. Can you send me a snippet image or code here? I need to see where the files should be inside of what folder. Please take a quick look at the message that I've sent to Chris above. I've posted a quick snip of what my directory looks like inside of my "project1" project.


Stephan van Hulst wrote:Aaron, in your other topic I posted an example of how to get JavaFX running using Maven. Once you have set it up, you don't have to look at Maven again unless you want to change something about the build process, and you can learn Maven when it suits you.

I wouldn't say JavaFX is dead. It WAS dead for a short while because there wasn't a party that was willing to maintain JavaFX. Since then various updates came out. Most online forums are just parroting what they heard once.

It's true that there's probably not a good single source for a modern JavaFX tutorial. I suggest you scrape by with what you can find, and post your code here for review. That way you will get up-to-date advice.

I think the frustration mostly comes from GUI coding being difficult in the first place, especially if you've only experienced the underlying infrastructure for only a month. You rushed into JavaFX without really getting familiar with the language and build tools. I'm not saying you shouldn't have, sometimes that's how we do new stuff. But it's important to realize it's not the ideal path.

We're here if you need help. And if you just need to vent, that's okay too.

 
Aaron Esteban
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I finally got it all figured out!!!

I managed to create an "UBER FAT .JAR" file and then package it all up using the Jpackage on the command line.

So here's a brief summary of how I did it:

Step 1. I started a JavaFX project inside of Eclipse and built out my FXML GUI in Scene Builder.

Step 2. I converted it into a "Maven Project" to compile a nice "Uber FAT jar".

Step 3. I went on over to the ol command line, then ran the "Jpackage" commands to convert the "Uber FAT jar" into a Windows executable file to make it easily distributable on Win OS.

These are the broad ideas of how I managed to make it all work out. If you guys need me to post some code here, let me know. I'm here to help as well. Thanks again for all of your ideas and support!

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, you got JavaFX to work for you. Then you don't need this advice:

The latest version of JavaFX is here: JavaFX (openjfx.io)

And, the guide to getting started with JavaFX is here: Getting Started with JavaFX (openjfx.io/openjfx-docs/)
 
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic