-1
I am looking to develop a Java Desktop project and would like to analyze what would be the best API for it. I’m in need of something like the state of the art of desktop Apis for Java. I did a search and found more references to Electron, which is an API that allows you to use a container embedded in the application so that it is not exposed in a browser. I do not know if it is the only option (only found this current, Javafx and SWT seem to be outdated), so my questions are:
- Which Apis for Java are currently recommended for Desktop applications?
- Pros and cons of these Apis
All desktop in general I believe is lagged nowadays. Java even worse, by not having Ipps q suitable for desktop. Until pq the future is cloud, so not investing in desktop would be backward even.
– user28595
https://josephg.com/blog/electron-is-flash-for-the-desktop/
– Victor Stafusa
@Articuno, but we have for example Ides that are Desktop. I think we’ll still have this for a while, so I think it’s important to think about current ways to develop for Desktop.
– Giuliana Bezerra
I find it curious you talk about Java Desktop API and quote Javafx, SWT and Electron, but not talk about Swing which is the standard library for this.
– Victor Stafusa
@Victorstafusa, Swing is no longer supported since Java 8. What came to replace it was Javafx.
– Giuliana Bezerra
@Giulianabezerra Where did you get this? Swing is supported yes in Java 10 and also in 11 Early access. On the contrary, the API that Oracle is looking to throw away in Java 11 or 12 is Javafx. In fact, the other day I saw a method in Swing that was added in Java 9 or 10, I will search and pass you the link. In fact, note that neither the module
java.desktop
nor the packagejavax.swing
have a@Deprecated
.– Victor Stafusa
What is no longer supported are applets since Java 9. But applet is one thing and swing is another.
– Victor Stafusa
Annotation
@javax.swing.SwingContainer
- Since Java 9. Packagejava.awt.desktop
- Since Java 9. Relevant link.– Victor Stafusa
Swing stopped being updated since java 8, but never entered status
deprecated
or removed. Anyone who wants to use, api ta ai available, just can not expect improvements from the java maintainer, because this will not occur anymore.– user28595
@Articuno and Giuliana Bezerra - https://bugs.openjdk.java.net/browse/JDK-4842658 - Please note that here, (Java 11 EA) you find two methods
addAll
. But here (Java 10) you don’t find them.– Victor Stafusa
@Victorstafuses this I agree that it has to fix even, bugs, as old as the api is, it’s inadmissible to keep it, but I meant improvements of the kind, the swing api is a little bit performance and complexity, if they were aiming to improve the api, I think there’s a lot to be improved around, the swing multithreading is already something to study, especially, I find it very bad to manipulate things using that swingworker. This in situations that it is feasible, of course.
– user28595
@Article That I Linkei above is not exactly bug fix, but rather improvement, although this is debatable. You may well put a
for
(or even use a stream) to call theadd
in hisDefaultListModel
, adding items one by one, or using your own implementation ofListModel
to do something more complex. What this small change gives, are methodsaddAll
to be more convenient to use and also to perform better by decreasing the overhead generated by adding the elements one by one.– Victor Stafusa
@Articuno However, it is true that Oracle provides few resources (financial or human) for the development of Java on the desktop and has little interest in making more available, and that is the main reason why things there go quite slowly.
– Victor Stafusa
@The fact that it has stopped being updated for me is disuse of the API. I believe they only use it in the market because they haven’t migrated to newer things yet.
– Giuliana Bezerra
Since it became forum, How is the situation of Java GUI? If you want can respond in chat...
– Maniero