Netbeans JSR-296, Swing and JavaFX, what are we now meant to use?
Asked Answered
K

2

6

I am starting to learn Java development (I used to develop in C++), I am using some older materials, however, I would also like to keep up to date with Java developments and recommendations.

I did some background research regarding Swing and JavaFX. I learnt that development on JavaFX script has stopped, however, version 2 of FX is in development so I am not sure what this will end up being as I thought the scripting as a major part of the standard.

When using Netbeans I discovered that further development on Swing is to stop and too is Netbeans support (JSR-296). Netbeans recommends moving to the Netbeans Platform API which I am reluctant to do because I want to learn Java as a true cross platform language and not be tied to any particulars.

This begs me to ask the question what is the preferred new approach to deveping GUIs in the Java world?

Kibitz answered 11/2, 2011 at 19:22 Comment(2)
Why do you think learning NetBeans Platform will hinder your knowledge of Java as a cross platform language? NB Platform (sepite the name) is just a framework for rapid application development.Sixfold
I dont want to be tied down to any particulars considering I also use eclipse and several other IDEs and development platforms it would make sense to myself not to be dependant on Netbeans as a framework or IDE. Therefore I would prefer to invest my time in learning standards that i could use across the board. If that makes any sense lolKibitz
H
2

You will probably find the Wikipedia page about JSR-296 informative.

Swing is an API that lets you work with various graphical 'controls'. You can arrange them is any number of ways to create a GUI for your application.

The Swing Application Framework (JSR-296) was and effort to create an API that would create a 'standard' way of writing applications, that would use Swing to present the UI.

The NetBeans Platform is a different effort with similar goals to JSR-296... though it does encompass some other areas, like modularity. The NetBeans IDE is built on the NetBeans Platform. The NetBeans Platform uses the Swing API to present UI.

SWT is an API at a similar level of abstraction as Swing.

The Eclipse Rich Client Platform (Eclipse RCP) is another application framework. The RCP is based on SWT. The Eclipse IDE is based on the Eclipse RCP.

You should know that:

  1. You do not need to use the NetBeans IDE to create an application based on the NetBeans Platform.

  2. You do not need to use the Eclipse IDE to create an application based on the Eclipse RCP.

Haemostatic answered 12/2, 2011 at 1:15 Comment(3)
Many thanks for explaining. I dont really want to use any app framework at this stage i would like to learn the raw basics of Java and Swing. However, would prefer to use a GUI builder to make layout design easier.Kibitz
I believe i can do the above still with netbeans, however, I am moving way using it as a IDE since Netbeans announced the removal of Ruby on Rails. So eclise's visual editor looks like the best route.Kibitz
@andicrook - I think Eclipse's VE creates SWT interfaces, not Swing interfaces... I may be wrong about that, though.Haemostatic
A
0

Swing (Java) or SWT (Eclipse) - both are very much alive.

JavaFX should be considered a failed distraction of Sun's (now Oracle's).

Abortifacient answered 11/2, 2011 at 19:47 Comment(9)
I am i confused? is a java + swing builder != JSR-296Kibitz
java + netbeans swing builder != netbeans JSR-296Kibitz
Oracle/Sun don't develop Swing much anymore. It was long time they released new things and there are major bugs that haven't been fixed for a long time. E.g have a look about the SwingWorker bug on this answer: #3306091Aston
@Aston which is why I ask what are sun promoting as there preferred UI framework?Kibitz
@andicrook: Swing is the Java GUI framework. But Java is mostly used at the server side and not for GUIs, so if you want a good GUI, have a look at C# and WPF, Objective-C and Cocoa or C++ and Qt.Aston
@Aston That rather defeats the object of a cross platform application which I am looking for and having to rewrite code each time. As for Java not been widely used for GUI based applications I think that statement is wrong Android apps are Java based as well as several other mobile app platforms.Kibitz
@andicrook: If you can't live with Swing, there are better alternatives. Adobe Air is one. But I have heard that C++ Qt is the best cross-platform GUI framework at the moment. I also think that Silverlight is an alternative. But cross-platform GUI-development has some drawbacks compared to the native frameworks.Aston
@Aston I don't think you understand, I need to learn Java, I have been given the task of learning Java, no other languages. Regarding UI frameworks I only care about Oracles recommended choice(s), is it still Swing ? What I care less about, at the moment, are what i call the middle ware frameworks such as JSR296, Netbeans api or eclipse RCP and third-party libraries.Those are used to cut corners, simplify or add functionality, I rather have a better understanding what happens under the hood and as Sun or Oracle originally intended. I will move on to other frameworks and libraries later.Kibitz
I would work with Swing for now, and later look at JavaFX 2.0 once it comes out. Look at javafx.com/roadmap to see the features that will be in JavaFX 2.0.Celaeno

© 2022 - 2024 — McMap. All rights reserved.