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.
Related
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 2 years ago.
Improve this question
i would like to update from Oracle Java to Adopt OpenJDK.
Therefore i have some question before i start doing the update:
Some information about the application i use:
2 applications
Application 1 uses Java 8
Application 2 uses Java 11
My Questions:
Are there any known problems updating from oracle Java 8 to AdoptOpenJDK 8?
Are there any known problems updating from oracle Java 11 to Adopt OpenJDK 11?
Is it even possible to run a Java 8 Application on Java 11? (Can i use Adopt OpenJDK 11 for both applications?)
Is there any guideline to update from Oracle to Adopt? (Or just straigt forward?)
best regards
For a given Java version (since Java 8), the various commercially-supported OpenJDK builds are almost drop-in replacements for the Oracle JDK.
If you're writing an application with a GUI, you'll find some differences in the fonts, and in colour profiles. The Oracle JDKs also have better support for Java Flight Recorder (if anybody uses that). There's little support in OpenJDK for the ancient Java Web Start, but there are alternatives.
In my experience (which is nearly all in middleware), choice of JDK (for a given version) is almost always a decision about support, and rarely about features. I've rarely encountered any technical problems moving from Oracle JDK to OpenJDK, or vice versa.
I've also not found any problems running Java 8 applications with Java 11 and later. However, Java 11 decoupled several components -- again most related to GUI applications -- into separate JARs.
But, in the end, this is all a matter of testing, isn't it? If your testing is sufficiently thorough, any problems with compatibility will be flushed out. I certainly wouldn't rely on anybody else's claims of backward compatibility without thorough testing.
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 5 years ago.
Improve this question
The target environments of my code use older Java versions (Java 7, Java 8). I use JDK 7 for development.
Will there be advantages if I use the most up-to-date JDK for my development, which is JDK 9 (and specify source=1.7 and target=1.7)?
I am aware that my code must not use any API which is not availabke on the target platform.
For the can I? Yes. Since backwards compatibility is important in Java, there's no technical reason why you couldn't do it. Sometimes company policies mandate a specific JDK version for development though.
In general the main advantage of using a later version of the JDK than what you're developing for is getting familiar with the later version. This may also increase your interest to migrate the software itself to a later version, if you notice it to be useful: for example you notice you love lambdas, so you migrate from Java 7 to Java 8.
Since the resulting bytecode is the same (not that it really matters) and the tools you use usually don't depend on the JDK, it has very little other effect. You can (usually) run code safely on newer JREs, so there's no difference with that either.
For the should I?
Whether you should start using JDK 9 now is primarily a matter of opinion. As Oleg pointed out it's not actively pushed everywhere, so at least you're not late and have time to consider moving forward for a while still (maybe toy around with it first before considering it for work use). Due to the large architectural differences between Java 8 and Java 9, I'd expect there to be a lot bigger gap in acceptance than between older versions.
However it's not all gloomy. There's a pretty good wrap-up of the features here and even if you are sticking to Java 7/8 projects for the time being, I see no reason not to do that on JDK 9 when you feel you're ready to have a look at it (and there is no hurry). I haven't installed it yet, although I've read about the decisions (good choice they didn't remove Unsafe).
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'm really new to Java and I'd like to ask you ,which aspects of Java SE are considered to be necessary for someone wanting to learn Java ME? Something like prerequisites.
To start with Java SE, I chose this book, but since I don't have much time, it would be great to hear from experienced developers which parts I should definitely focus on and which parts I could skip to save time.
If is there any topic from Java SE that could also be considered a prerequisite for Java ME, feel free to mention it.
According to content in the book that you mentioned in the questions
Section 1 is must, would teach you basics about java.
Section 2: If you have already worked in any oo language then you can skip this section and come back to it later stage.
Section 3 and Section 6 will be good for you as the code you need to write , need to be memory efficient and multi-threaded.
If you really need to learn JavaME from Java SE, then you should read an old Java SE 1.4 book, and just stick to the basics of the language.
Why? Well Java ME is based on JRE 1.3, so there are no generics, no collections (added in Java 6) and let alone Java 8's new stuff. If you buy a recent Java SE book, you might get confused because you won't be able to use these new features.
Second thing that differs, it is not an homogeneous platform. It is divided in two parts (CLDC/CDC for the core classes, and MIDP for the GUI classes). And there are optional profiles (JSRs) that migh or might not be supported in a certain device.
Other than this, you should always keep an eye on memory efficiency. Old devices do not have much RAM, so you should never try to load large images or data in memory, and always free resources when not used.
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
Java 6 is a stable version of this programming language. But I would like to upgrade to the current version java 7. At this time, is recommended to use java 7 in production? Where I can find updated information about the possible problems that I can get if I upgrade to java 7?
Why use or not use java 7 to make JAVA EE applications
This was added later. The main reason not to use Java 7 is that your web server might not support Java 7. e.g. some very expensive EE servers haven't got round to migrating to Java 7 in the 2.5 years since it was available for testing. IMHO this is pretty poor given the money they charge.
At this time, is recommended to use java 7 in production?
AFAIK, Java 7 is more recommended than Java 6, give it is not supported for free any more.
Java 7 is a requirement for the G1 collector, Java Mission Control and JavaFX 2.
Note: with Java 8 coming out soon with many new/powerful features, I expect many developers will be using it by the middle of 2014.
Where I can find updated information about the possible problems that I can get if I upgrade to java 7?
Most of the problems have been around client applet security.
https://blogs.oracle.com/henrik/entry/migrating_from_java_se_6
http://docs.oracle.com/javase/7/docs/webnotes/adoptionGuide/
http://www.slideshare.net/myfear/practical-migration-to-java-7
http://publib.boulder.ibm.com/infocenter/ieduasst/v1r1m0/index.jsp?topic=/com.ibm.iea.was_v7/was/7.0/Architecture/WASv7_JavaCompatibility/player.html (note this has audio)
You should use a supported Java version. Have a look at the Oracle Java SE Support Roadmap. Java 6 has reached "END OF PUBLIC UPDATES" - so it is not supported anymore.
At least you should run your Java 6 code on a Java 7 VM.
Aside from the convenient improvements to the language in 7 and the fact that 6 is no longer supported, there were some very serious security issues with 1.6 that caused Apple (amongst others) to drop default support for Java.
Those issues were fixed with 1.7 and for that reason alone, you should update.
Two blogs detailing the controversy below;
http://www.intego.com/mac-security-blog/apple-drops-java-in-latest-os-x-security-release/
http://www.darkreading.com/vulnerability/apple-removes-default-java-support-in-br/240009305
it is dependent, if you are going to make an application for android you may use Java 6, but if your creating a application for desktop it is recommended to use Java 7.
Java 7 have some improvement of course, specially on file io, which is .nio package.
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
Is swt faster than swing?
Where can i get good tutorials
about swt?
it easy to migrate from swing
to swt?
See this web sites:
SWT, AWT and Swing
Swing vs SWT
Swing vs SWT(2nd)
Very nice webpages with example source code:
SWT
SWT 2d-Graphics
I think it's important to remember SWT came in to being when Swing was very immature and I guess the Eclipse folks thought it necessary to reinvent-the-wheel (suspect in retrospect that's something they regret, however thin a layer SWT is).
Nowadays Swing has matured, many of the problems and performance issues it used to have have been fixed and with the 3rd party extensions like JGoodies and JIDE I can't think of a good reason you would use anything but Swing for thick-client development.
There's a comprehensive tutorial here which takes you from 'Hello World' up.
Swing and SWT are two completely different APIs, although the principles are the same. MIgrating your skill is easy. Migrating a program, however, would be a lot of work.
I think you will experience some headache if application is to be run on different OS-es, dont know for now, but before there was no support for Mac OS, so forget about it if your app is to be run on Mac OS.
We also had this question in company and decided to go with Swing, because for normal desktop application you just cannot sense the speed difference which is supposedly on SWT side, and this speed you are buying with ruining WORA principle, you have to bring with your application needed .dlls or .so files to natively support your application running in desired OS-es.
For long time Swing part of Java (with printing) was weak point of Java. I think they will make much more out of Java if they succeeded to make Swing simple, intuitive and responsive at that time. Nowadays they made some positive steps in it, although still can be said, swing is big, complicated..