Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I am learning JavaFX, and it seems very cool, but pretty nasty too. As far as I got it, the GUI is written in XML, and exported in the exact same form (not being converted or anything), and the XML is being read with FXMLLoader, every time the window opens up. Also, JavaFX has much more features than swing (rotating, 3D, etc). So my question is:
Is JavaFX significantly heavier for the performance, comparing to Java Swing? If it is not, then how heavy is it?
In the early days of JavaFX, I tried it out to show a large graph (thousands or tens of thousands of nodes and edges), and found that it was slow compared to displaying the same graph structure in Swing. However, most user interfaces are much simpler than what I was displaying, so any speed difference is irrelevant. Since those early days Oracle has put a lot of work into making JavaFX as fast as Swing. Today's performance in JavaFX is much closer to the performance of swing.
Here is a writeup of someone experience in switching from Swing to JavaFX:
http://www.oracle.com/technetwork/articles/java/casa-1919152.html
The author says:
Performance—Our overall impression is that JavaFX provides the same high level of performance as Swing when it comes to assembling and rendering screens with many components. And JavaFX provides much better performance in the area of transitions and animations (Swing provides very limited functionality in this area). Overall, performance is not an issue.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I find JavaFX from my perspective more modern and better to use than Swing.
I read a document about the future of JavaFX written by an Oracle employee and came across a sentence:
Oracle is reaffirming that Swing and AWT remain core Java SE
technologies to Oracle across all Java SE releases and support
timelines.
Why is Swing supported in newer JavaSE versions, but not JavaFX?
That is a business question.
One answer is that they wanted to be able to separate the JavaFX release cycle from the main Java SE release cycle. Though as it turns out JavaFX is following the new Java SE release cadence.
A second answer is that separating them possibly makes project governance simpler.
But why JavaFX and not Swing?
Again, business reasons:
JavaFX is perceived as more "niche" than Swing is. So splitting it out is perceived as more acceptable.
Swing (and AWT) are widely used technologies in old projects. And by old, I mean "mature" / "legacy" projects that have been around for over 20 years. Separating Swing is more likely to break more old projects.
Major changes that "break" old customer code or practices are bad for Oracle's business model. They annoy corporate customers who pay substantial Java license fees, who might be considering a "strategic" switch to some other language.
Swing (and AWT) are not under active development, and hence they won't normally present such a drag on the main Java SE schedule as JavaFX may do.
Anyway, this is all moot. The decision to split out JavaFX and not Swing was made years ago. It happened. Live with it.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm making a small 3D physics simulation program in javafx and I looked onto various ways of doing the physics calculations in a separate thread but with little experience in multi threading I find it hard to find the best approach to calculate the physics and passing them to the javafx application
so my question is
What is the best way to do background calculations in javafx?
how to synchronise and pass data between physics thread and javafx application?
Read the JavaFX concurrency documentation: Concurrency in JavaFX, javafx.concurrent.Task and Platform.runLater. I won't re-explain it here, as all the base information you need is in the official documentation IMO. For additional information you can just google for JavaFX threading and concurrency, which will turn up numerous stackoverflow questions that provide further information on this topic.
Consider if you really need your own thread. Likely, the physics calculations can be performed quickly on the JavaFX application thread and your own thread is not required.
its a 3d gravitational simulation of multiple objects >1000 so my performance really drops when I do the physics calculations.
You could use a Task with a fork/join to do calculations in parallel. Once all calculations are done, you can make a Platform.runLater call to update the UI based upon the updated calculations.
Note that properly implementing fork/join might be kind of complicated for you. You might want to try just running the calculations in their own task and invoking Platform.runLater when they are done before you attempt the additional complexity of adding something like fork/join.
what would be the best way to implement my main loop with as I mentioned above I tried Timeline and AnimationTimer, I read AnimationTimer should be better but is there any other alternative?
As you state that performance when everything is done on the JavaFX thread drops too much, then neither a Timeline nor an AnimationTimer will help you all that much as they perform their work on the JavaFX application thread. If you wish, you can try the Task with Platform.runLater call approach as outlined above instead.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
My friend says I should pick up the Android App Development for Dummies and I'll be fine, just learn as I go [http://www.amazon.com/Android-Application-Development-For-Dummies/dp/1118387104/ref=pd_sim_b_3?ie=UTF8&refRID=15GHNG7MTDPPEX6JFEC5 ]
I don't want to waste time learning any concepts related to web development/GUI with Java and want to learn Android instead, but I feel concerned with my lack of comprehensive knowledge on Java so I would like an answer from a broader community of Android/Java developers.
For context; I've already learned:
OOP Concept, Variables, Methods, Classes, Objects, Constructors,
Interfaces, Abstract Classes, Control Structures i.e. loops and
branches
I have NOT learned:
ArrayLists,
Threading,
Map / Hash,
GUI / Swings, etc
What do you guys think?
My personal opinion is that if you switch to Android too early, that might slow down your progress. Programming Java on a PC is more transparent, and it is still easier to find solutions to common issues regarding it on the internet. ArrayLists, multithreading and HashMaps are very basic and necessary tools, you will not go far without them, and it will be faster to learn them first on PC and then more painlessly and quickly switch to Android, in my opinion.
Of course you can.
Sometimes even a simplest application needs more that you have right now,
but while knowing a little more you can build simple applications
and you will need to learn a lot about Android itself.
http://developer.android.com is an excellent place to start.
Yes,you can.But I would suggest you to learn a bit about basics of GUI and some other java concepts and then move onto android.It wont take long.But even without learning it,with much more effort you can move onto it.You can take help from these reference websites:
http://www.vogella.com/tutorials/Android/article.html
http://developer.android.com
Books:
Hello Android
Professional Android 4 Application Development
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm developing a java-database desktop application using netbeans and swing. The application has so many features that creating gui has become a problem and it has a very old look when compared to other modern applications. I found javafx, swingx, jgoodies, netbeans platform and so on...and the discussion on these topics is never ending!! I need good support for customising tables,trees, toolbars and skins. what should i use??
i would suggest you to go for javaFX. I had earlier worked on swing but now moved to javaFX.Benefits are
Good look and feel
can be used server side also.
Use the simplest method possible. Seriously, whatever you find easier go with. I find Eclipse Windows Builder is better than Netbeans but if installing the Eclipse plugin. Netbeans is probably a lot simpler than Eclipse Window Builder, but some people like me prefer Window Builder. Go with whatever you find easiest.
GUI building is complex in Java, they designed it well so it is hard as a novice to jump in, and it is better to start running then learn as you need more complex features. Google then becomes a good ally.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am currently writing a Turret Defense style game using the GTGE engine, this engine has the ability to use either JOGL or LWJGL to drive the graphics and so I was wondering, which one should I use? What are the pros/cons of each? What factors should I consider when deciding?
In my game development I had the following decision points:
2D or 3D game?
How many time do I want to spent on development?
How many control I want to practice over my rendering/game?
How well can I model my game using an engine?
What are my performance expectations?
What kind of licensing will I release my game?
As I know, JOGL seems to be more in focus of Sun and other developers. I would expect bugfixes and enhancements more frequently.
If changing the driver does not require game/model changes, you could just benchmark both drivers. Then you could compare them based on memory consumption, rendering quality and speed.
I have used JOGL and my experience was preety good.
Also my reason for Opting JOGL was Sun backing.If both suits to your need then its better to go with widely accepted Api and at that time it was JOGL.