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 8 years ago.
Improve this question
I am planning on starting the development of a desktop app, but until now, for me, desktop = swing. I did a little research about it and found myself under some questions:
I found that there are a lot of JavaFX versions:
There is JavaFX 1.0 that people say is old and outdated;
There is JavaFX 2.X that is very good;
And now JavaFX 8 (is this correct?);
But even with the most recent NetBeans IDE version (8.0) with JDK 8 (1.8.0), when I create a JavaFX application, it starts using JavaFX 2.2 – Is JavaFX 8 really a new JavaFX version or people say it just because they use JavaFX 2.X with JDK 8?
Another question about versions, will applications developed in a version X of JavaFX be compatible with higher versions? Just like a swing application, where if you developed an application in Java 5, it would work even on Java 8.
About development patterns, more specifically about layout creation, I noticed there are two ways for creating layouts: By just coding it in Java, and by creating XML files (FXML) with a Java Class as a controller (More MVC approach) just like a JSF application. Which one should I choose? What are the pros and cons of each one?
Welcome to the world of JavaFX
I am not sure why you are facing such an issue of JavaFX 2.2 with JDK 1.8 because JDK 8 has JavaFX 8 in it and it must be used by default.
Just to give a quick introduction on JavaFX and how it is different from Swing. Please follow the following points:
Instead of following the legacy of building the view/UI in Java code and messing your functional codes with views, you get the opportunity of separating the view with the functionality using the FXML introduced in JavaFX 2.0+
JavaFX has powerful CSS integration which allows you to decorate the view, which was absent in Swing.
The development is quicker, as you have SceneBuilder to back you.
For more differences on Swing and JavaFX please follow (though the answers are old and many things have changed. JavaFX has become bigger and better!)
https://stackoverflow.com/questions/1318645/JavaFX-or-swing
JavaFX 2 vs Swing for a pure Windows desktop app
Difference between JavaFX 1+, 2+ and 8+
JavaFX 1+ was basically a scripting language called as JavaFX script, which was very different from the Java language.
JavaFX 2.0 changed the face of JavaFX. All of JavaFX API was now available as pure Java API. FXML was also introduced during this phase in JavaFX!
JavaFX 8.0 leads to a new face of JavaFX where JavaFX is accepted as an integral part of Java 8.
Compatibility - All JavaFX application is forward compliance, i.e. JavaFX 2.0+ is compatible with Java 7, 8 and above. Though applications made using JavaFX 8 is not compatible with Java 7.
JavaFX 1.3 support has been killed from Java 1.7.
Development Patterns
JavaFX gives a chance to build your application using your choice – i.e. use the legacy method of building the view using pure Java or use FXML.
JavaFX strictly follows MVC pattern, separating your view and its events. The views are created using FXML and the controllers are Java files.
From Oracle docs
From a Model View Controller (MVC) perspective, the FXML file that contains the description of the user interface is the view. The controller is a Java class, optionally implementing the Initializable class, which is declared as the controller for the FXML file. The model consists of domain objects, defined on the Java side, that you connect to the view through the controller.
Some more information and pro's for FXML, please follow:
Which is better way of programming in javafx?
Related
This question already has answers here:
How to make an executable JAR file?
(5 answers)
Closed 6 years ago.
I've got a bunch of data stored in tables through Mysql on which I've done some analysis and also export microsoft excel to make graphs and such but the customer wants it to be a desktop application which I have never done before. Currently working in Eclipse. What is the simplest (or any really) way to make a desktop application?
EDIT: I don't think I was clear and that is my fault. I know how to make a GUI in Eclipse I just don't know how to make the desktop icon that will bring up the GUI I make.
For beginners you can start with Swing or JavaFx. It's easy to learn plus they have some excellent tutorials or you can look use more mature Java Frameworks such as Apache Struts, Spring MVC etc.
You can also try netbeans IDE. It has native support for building JavaFX Application and Swing application.
Just make sure you install required plugin to setup your environment in eclipse. For JavaFX you'll need JavaFX plugin: e(fx)clipse.
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 6 years ago.
Improve this question
I am currently working on an application with a code base that dates back to at least 2001. One of the components of this system is a desktop client that is written using Java Swing. It uses most of the good old layouts including BorderLayout, FlowLayout, and Gridbag layout. There are a number of fairly complex screens we need to manage and update periodically and we sometimes need to create new features with new user interfaces.
Is there something better than Swing we could look into migrating to?
Would it be possible to do this migration in stages (i.e. we would have a mix of the old Swing components with the new components during a prolonged migration phase)?
If we were to re-write the desktop client in Java today should we still use Swing?
I find myself using primarily GridBagLayout, is this still the tool of choice for more complex layouts or are there better layouts I could be using?
I was reading in book that Oracle intend to replace Swing by JavaFX.
Take a look in the question and answer bellow:
6. Is JavaFX replacing Swing as the new client UI library for Java SE?
Yes. However, Swing will remain part of the Java SE specification for the foreseeable future, and therefore included in the JRE. While we recommend developers to leverage JavaFX APIs as much as possible when building new applications, it is possible to extend a Swing application with JavaFX, allowing for a smoother transition.
You can see there original comment here.
In this case, I believe that you can consider to user JavaFX.
More details here and good examples here.
If you are using Java 8 you can use javafx for new componant. It's possible to use Swing componant with javafx.
you can still use java swing, but if you need to migrate you can migrate in stages using JavaFX (again a Desktop Client). if you need to use Web Client, then you could use GWT (this helps since the developers already have knowlege of UI Components) and GWT code is in Java and Javascript gets generated in Compile Time.
Java FX is more powerful and beautiful
We can say that swing is replaced with java FX.
Now a days no body is using swing because there are lot of advantage in java FX over swing
It has good feature called scaneBuilder we can just drag and drop the components to appropriate position so lot of time is saving.
Different type of layout are there to place the components attractively.
Impertinently we can use CSS to disign the UI so is more beautiful and attractive
we can integrate with web components also.
If you're redoing a layout entirely, I'd look at Matisse which uses Spring Layout.
https://netbeans.org/features/java/swing.html
It's far easier to get the relationships between components using a layout tool than trying to line everything up manually in GridBag or something similar.
If you're not redoing a major part of the code, I wouldn't touch it. Don't fix what ain't broken.
Regarding JavaFX, I personally have not been impressed by it. You can take a look at it, but JavaFX struck me as needing more "bake" time. I would not abandon Swing just yet.
If you need to have a Java desktop client looks like native application for some platform (Windows, MacOS, Linux) you can look on Standard Widget Toolkit (SWT) library.
One famous application example of usage of this library is Eclipse IDE. Another - Angry IP Scan, sources are at GitHub.
This question already has answers here:
Swing vs JavaFx for desktop applications [closed]
(6 answers)
Closed 7 years ago.
I am using Java Swing to develop my application and i should finish it as soon as possible, but the design is very bad.
I found some advice which tells me that I should use JAVA FX.
What is the difference between Java FX and Java Swing ?
Will there be any change on the line of code?
Main difference could be the release date... JavaFX is more recent and can be considered as the successor of Swing.
There is many very useful features added in JavaFX.
See here some key features : https://docs.oracle.com/javase/8/javafx/get-started-tutorial/jfx-overview.htm#A1131418
I can list the main features for me:
Styles can be set by CSS (something similar to)
Bindings: easy way to bind a ui-value, like width of text of input, to a field in class. Changing the value of the field updates the ui without boilerplate
Animations/Transitions: easy way to make an animation, like a ui components which blinks or moves
3D: easy way to manipulate model to make animated 3D view
For making a new application from scratch, i think you should consider using JavaFX, Swing is outdated (imho)
This question already has answers here:
Java GUI frameworks. What to choose? Swing, SWT, AWT, SwingX, JGoodies, JavaFX, Apache Pivot? [closed]
(9 answers)
Closed 8 years ago.
Is there any alternative of swing?
I need a high performance GUI toolkit to create desktop application on linux (Ubuntu). I've been creating swing application for 2 years, therefore I want use java.
Yes, there's a number of other UI toolkits available - AWT, SWT, JavaFX, QT to name a few.
I'd primarily recommend JavaFX as the new UI toolkit (it's now part of Java8 and is still under heavy development) or perhaps SWT if you want the "native" feel (since it uses native OS components.) QT does this as well of course, but it requires bindings and is generally more of a faff - so its use is relatively rare in Java land.
On the other sided of things, I'd recommend staying away from AWT (it's the old, original Java GUI framework that lacks many common components in other UI toolkits, and is not really supported any more.)
Try Java FX. It will give you better performance than java Swing. Java FX
Take a look at JavaFX it's now part of the JRE/JDK for Java 8.
http://docs.oracle.com/javase/8/javase-clienttechnologies.htm
You can probably use SWT as an alternative.
https://www.eclipse.org/swt/
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
These days I got an offer related to a desktop application that I should create.
I'm a Java programmer. I had worked with Swing API about 4 years ago, so I can say that I have some experience with it. I also had worked with Flex 4 about one year ago, but I think it is not a good option for what I need. In my opinion it is not stable enough (present some strange behavior) and I think it is no longer maintained for Linux platform. - (if you think I'm wrong here, tell me).
So, I search for a good Desktop UI API that I should use with Java.
What are the actual desktop UI "trends", taking in account that questions on that issue are relatively old on SO?
N.B. When it comes to talk about platform independence and SWT, I think there are some issues. That's why I would not opt for it.
I would personally use JavaFX for any new UI development work in Java - it's now a 100% Java API and Oracle appear to be pushing it quite strongly:
JavaFX has become more tightly integrated with Java SE, and will soon become a standard component of the platform. Starting with JavaFX 2.0.2 / Java SE 7u2, the JavaFX SDK has become part of the Java SE 7 JDK, avoiding a separate download for developers. The next step in this integration is to include the JavaFX runtime libraries as part of the JRE, which will be achieved through the Java SE 7u6 / JavaFX 2.2 releases in summer 2012. This will ensure widespread adoption of JavaFX on Java-enabled computers, while leveraging synchronized updates and security fixes.
Having used it myself, in my opinion it's also far nicer than Swing in its API (more like SWT in that respect), looks far nicer by default, and far more flexible in what it allows you to do.