I have been studying Java for about two months. My thinking behind my choice was that Java allows me to target many platforms and also ultimately android. Lately I ve been having some reservations about Java and JavaFX in particular. When it comes to JavaFX, I cant really find any resources. I am looking for some demos to see what its capable of and all I can find is stuff from 2012 or so. The only thing thats worth looking at is ensemble which is old and also has some issues. The oracle site is a mess linking to content that hasnt been updated in ages (eg. http://www.jidesoft.com/blog/2013/06/06/jidefx-beta-release/). In general googling around I am getting the imrpression that no one is really interested in JavaFX or using it. I havent found any discussions like the one I am trying to start here for instance.
Another issue is that supposedly it can run in a browser. Well, I d like to see that ! Are there any demos I can find? I only found one that actually worked (kinda, it opened but was unresponsive). Also, it has support for touch/multitouch events. What exactly are those for and how is a JavaFX app going to run on a multitouch device? Its practically impossible to develop for android or iOS and Java doesnt have a native platform (on desktops or mobiles) so whats left? Maybe microsoft surface? Why wouldnt I use C# or VB for windows only apps? Will JavaFX apps run "natively" on windows 10 phones? Supposedly they will run full windows from now on. Long story short, from what I ve seen, JavaFX is only good for old fashioned GUI dekstop apps which can be made with any other framework or language.The one thing that really drew me into it though was how good the controls look, and in general the whole GUI can be made to look gorgeous and modern, with the exception of some controls which look out of place (eg. tabs).
Also, the procedure of making GUI's with SceneBuilder (which also hasnt been updated in a year...) is clunky at best. The FXML cant be automatically injected and I just have to paste the sample controller any time I make a change or simply redeclare the nodes by hand in the controller which is just so awkward (I think theres tighter integeration with NetBeans, I am not sure how that works but I know you can build a controler through the IDE). Also for some reason I am getting a NoSuchMethodException when accessing nodes declared by @FXML in the controller which work just find if I declare them as Node_Type Node_Name = (Node_Type) root.lookup("#Node_Name"); Whats up with that?
In general, the lack of any native platform (for JavaFX and Java), the lack of activity and resources and this general sense of decadence I am getting from the whole "ecosystem" (there isnt one) makes me very wary of this platform and unfortunately I ve lost my motivation. I think I would have quit Java if it werent for the prospect of Android. But Android doesnt help my motivation for JavaFX . I could also add here that in my opinion Microsoft is doing a great job of bridging the mobile-desktop gap with products such as Surface and Windows phones (lets see how that works out...), which makes me think maybe tageting the windows ecosystem might be a better idea in the long run and I dont feel Java or JavaFX are good choices for that.
I apologize for my negativity but thats how it came out :P I would appreciate any thoughts on any of the points I made.
Apologies for an earlier version of this post, I pushed the send button before I had completely formulated it and the earlier version was not worded as I would ultimately wish.
There is some truth and many inconsistencies and misunderstandings in your post.
I advise not trying to start a constructive conversation with such negative wording and such a negative point of view.
Many of your concerns have already been discussed in other posts in this forum (see posts by Hendrik Ebbers - just search the forum for "Hendrik").
In general, I prefer to have just a single question and write a single answer to it rather than addressing things point-by-point => I find such a format more useful to future readers who might just be interested in one particular point rather than a large intertwined conversation mixing many points.
> I have been studying Java for about two months.
That is a relatively short time. You have picked up a good, but incomplete, understanding of some issues within that time.
> My thinking behind my choice was that Java allows me to target many platforms
> and also ultimately android.
It does, kind of. Outside of using the Java programming language syntax and semantics, Android is not really Java, certainly it is not Oracle Java. The android API and execution environment provided by Google differs from the the traditional Java Runtime provided by Oracle. If your ultimate target platform is Android, then I advise you to learn Android development based on Google resources.
You can write Java programs against a combination of the JavaFX API and the Google Android API and run them on an Android Phone when you ship your own Java virtual machine with your application. Instructions on how to do this are provided at the javafxports website. I advise such a route only under the following circumstances:
1. You have quite a bit of development experience.
2. You are OK with tackling teething problems and issues for which you may not receive a lot of assistance.
3. You aware that such work is under what I would term an "experimental" category and don't necessarily expect your resultant application to be a widely deployed production application within the next twelve months.
4. You motivation to do the work is either because you would find it enjoyable to work in such a way or because you want to use largely the same code base for multiple mobile devices (Android/iOS/rasberry PI).
5. You understand that to make full use of features provided by a given platform you may have to write some platform specific code.
> When it comes to JavaFX, I cant really find any resources.
> In general googling around I am getting the imrpression that no one is really interested in JavaFX or using it.
There are some people interested in using JavaFX (check questions under the JavaFX tag on StackOverflow for instance). It is more of a niche technology than server side Java development or iOS/Android development - the JavaFX development community is not as large as those development communities (by orders of magnitude).
You can get an idea of some of the things some people are doing with JavaFX by reading posts on the fxexperience blog:
> I havent found any discussions like the one I am trying to start here for instance.
There are discussions like this that I could link to. But personally, I don't find such discussions particularly useful.
> Another issue is that supposedly it can run in a browser.
I don't advise that method of deployment for JavaFX applications. A non-exhaustive list of why this is ill-advised is: browser based deployment of Java based applications increases the potential security attack surface of a client machine, is not supported on numerous common browsers (such as Safari on iOS), does not provide the application developer with complete control over the runtime environment of their application (the user can upgrade their Java version at any time, potentially breaking the application).
> Are there any demos I can find?
Not for browser based deployment, mainly for the reasons provided above.
> Also, it has support for touch/multitouch events. What exactly are those for
For handling input on devices which have touch pads and touch screens.
> how is a JavaFX app going to run on a multitouch device?
Depends on the deployment model. Normally, I recommend packaging and installing the JavaFX application (with a private java runtime) using the native packaging for the platform (e.g. .exe or .msi installer on windows, .dmg on OS X, .rpm or .deb on linux, .apk for android, etc). So you install and run the package on the target system just the way you would install any native application for that system and the JavaFX application will accept and respond to input from the multitouch device (e.g. if you click and drag on laptop touch pad, then your application will receive a click and drag event that it can respond to).
> Its practically impossible to develop for android or iOS
I disagree, many people develop for Android and iOS.
> Java doesnt have a native platform (on desktops or mobiles)
The native platform for Java is the Java Runtime Environment (JRE), it's a virtual machine which can run on many devices. You can use a JRE pre-installed on on the machine or, (my preferred method), include a runtime in your application installation package.
> Maybe microsoft surface?
Sure, you can run JavaFX applications on the more recent surface machines which use an Intel based architecture.
> Why wouldnt I use C# or VB for windows only apps?
You could, that is up to your personal preference and the technical requirements of what you need to get accomplished.
> Will JavaFX apps run "natively" on windows 10 phones?
I have never heard of anybody running JavaFX 2.x+ on a Windows Phone. Windows 10 doesn't launch until late 2015. I do not know if somebody will run a JavaFX application on Windows 10 once it has been released.
> JavaFX is only good for old fashioned GUI desktop apps
Desktop/Laptop based operating systems (OS X, Linux, Windows) are the primary development use-cases for JavaFX. They are the only environments which are officially supported by Oracle.
JavaFX based applications do work on a variety of non-desktop devices such as Raspberry PIs, android and iOS phones, etc. and development on these platforms is supported to a greater or lesser degree through third party sites such as javafxports.
> which can be made with any other framework or language.
Yes, you have a choice of implementation technology for your applications.
> SceneBuilder (which also hasnt been updated in a year...)
> The FXML cant be automatically injected and I just have to paste the sample controller any time I make a change or simply redeclare the nodes by hand in the controller which is just so awkward
Yes, that is mildly annoying to me.
Systems of JavaFX development based on alternate languages such as jrubyfx can perform automatic injection of FXML into ruby code. Unfortunately, I am unaware of a similar solution for development based on the Java language.
> Also for some reason I am getting a NoSuchMethodException when accessing nodes declared by @FXML in the controller which work just find if I declare them as Node_Type Node_Name = (Node_Type) root.lookup("#Node_Name"); Whats up with that?
Lookups are based upon a CSS selector operation applied to a node/object hierarchy in the scene graph. The CSS attributes for nodes get finally assigned to the nodes during a CSS application pass. By default the CSS application pass happens during a pulse, which, by default will occur sixty times a second. If you try to perform a CSS based lookup of a node before a pulse has been processed for that node and CSS applied for it, then the lookup may fail. You can manually trigger a CSS pass by invoking applyCSS on a transitive parent of a node: sample code for this is provided in the node.applyCSS() javadoc. However, your error seems more fundamental than just not applying CSS before doing the lookup. You shouldn't be getting NoSuchMethodException when calling root.lookup if root is a node, (as lookup is a method of node). So probably whatever your root object is, it is not a Node. If you still have issues with this, you can create an mcve and post it on StackOverflow to request further help.
Even with the above said, I don't know why you would do this in the first place. I usually don't recommend using the node.lookup functionality if you can avoid it (because of the confusing semantics around applyCss and because lookups are not strongly typed, so you lose some of the benefits of typed Java development). If you have a node in the controller annotated with @FXML, the FXMLLoader will inject a reference to the node into your controller class. So you can directly reference the node through the injected reference rather than using a lookup - so in this case the use of a node lookup function would seem to be completely avoidable.
> general sense of decadence
I don't think decadence is the word you are looking for here.
> I would appreciate any thoughts on any of the points I made.
You should make your decisions on technology to use based upon your own honest assessment of the technology and how it applies to what you want to achieve and what most interests you.
posted 4 years ago
I thought that apologizing for my negativity and the fact that its not directed against anyone in particular would make it ok since no one would take it personally. I apologize again in this case.
The point of my post though wasn't to ask any question in particular but to start a discussion about the topic, namely what is the state of JavaFX and what is it good for. I gave my thoughts as to what I think the issues are as I perceive them and my questions about the usefulness of JavaFX. The part about the exception was an unnecessary off hand remark
My post was a little bit ranty but thats how I usually come off.
Indeed some posts are tangentially related to my questions but I felt like my main questions are not addressed.
I would appreciate some clarification on what the truth and misunderstandings are. I think its very reasonable for someone who is just entering Java and JavaFX to have such concerns.
posted 4 years ago
I am sorry, I replied before reading the complete version of your post.
>It does, kind of...
I do realize android doesn't use the standard libraries or JVM but from what I gather, its essentially the same thing when it comes to writing code that doesn't involve the native android API so by learning Java I am learning a huge part of android development. I am also aware of javafxports but I would imagine that its capabilities are very limited since you cant create a native UI. It might be good for a game or something similar that doesn't need native controls.
Maybe I worded that the wrong way. I meant 3rd party resources, tutorials on the web, on youtube. Activity! All I see is some demos that feel like its just some people fooling around with a new toy. I want to see communities, detailed tutorials, recent uploads, custom controls, CSS stylesheets, apps (commercial and free). Something!
>There are discussions like this that I could link to. But personally, I don't find such discussions particularly useful.
Maybe they aren't, but its the only thing I ve got. I dont have any close friends that are software developers (only some who work on specialized computational applications) so my only sense of whats going on here can be gathered by googling all day and reading books. At some point, it doesn't cut it anymore.
>I don't advise that method of deployment...
You see, the reason why I thought that was because the book I am reading (Liang intro comprehensive 10E) presented JavaFX as a means of producing RIA when in fact it seems to be a simple replacement of Swing, just more modern (and I do agree it does feel really modern).
>Depends on the deployment model...
>I disagree, many people develop for Android and iOS.
What I meant was, since theres standard toolkits and API's for android and iOS why would you make a JFX app for those environments in the first place? You cant make a proper (read: native) UI in JFX for android and you can do that with the native API's plus everything else you can do with JFX. Whats the point of writing a JFX app for android unless you could make one single app that ran on both the desktop and mobile and could magically scale to fit the screen size. Thats why I am asking for windows 10. My idea is that since phones will be running full windows, in theory you could make one app that could run on the desktop and the phone/tablet. But still it would have to be aware of the form factor and the usage context (eg, when undocking the surface it goes into tablet mode. The app might need to know that somehow). Now if that works somehow thats great. You have a great platform and a great tool to work with. If not, JFX doesn't provide you with anything you don't already have on the mobile (even less in fact)
>The native platform.....
Again, maybe I should have been more verbose. What I mean by native is using the standard API's for the platform. Native controls, native GUI. Native in this context refers to the standard for developing for a platform. In windows C# VB (and metro apps with HTML intefaces) are native. On android you have the android API, in iOS you have COCOA touch or whatever its called. If you want to make "native" looking metro apps in JFX for instance what can you do? You can get stylesheets that mimic the look, but its not the same. How do you implement the new metro open file window? Thats a ton of work that probably won't pay out. The bottom line is java isn't the standard anywhere. Far from it.
>Oracle no longer support SceneBuilder binary releases.Binary releases are provided by the third party Gluon. Gluon have provided new releases of SceneBuilder within the last year.
I realize that and just yesterday I downloaded the new 64 bit binaries (which don't work on intellij idea for some reason) but the version number is still the same. Is SceneBuilder under active development?
> Lookups are based upon a CSS selector...
I think there's a misunderstanding here. The lookup works just fine. Its when the nodes are referenced through the @FXML declaration that I get the exception.
>I don't think decadence is the word you are looking for here.
Well maybe decadence is too strong a word but it captures the essence of what I am sensing. As Bear Bibeault put it in this thread