As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Most of the desktop application development I do is in Swing, and I'm curious to hear people's thoughts on using JavaFX and/or Adobe Flex for building desktop applications. Have you had success building desktop apps with these? Or would you stick with Swing for now and use tools to help make Swing development more productive?
If you're making desktop apps, I'd stick to Swing. JavaFX/Flex/Silverlight would be more appropriate for RIA - rich internet apps. Although I'd argue that none of them would be a choice for the long term - looks to me like HTML5/CSS3/Ajax are winning the day, but thats a pretty subjective area. But for desktop apps - I'm a big fan of Swing (also Java Web Start is a very underrated technology)
I would say that JavaFX can be seen as a kind of extension of Swing with a new way of developing a Java GUI by using a declarative programming language: the JavaFX Script. JavaFX Script code looks exactly like a JSON script, unlike Adobe Flex or Microsoft Silverlight which uses an XML syntax.
JavaFX Script can interface with Java and therefore can call Swing components easily. It's really a new generation of GUI API, like Swing was for AWT: nice graphical components, new easy ways to manage layouts, really nice features to build dynamic interfaces: bindings, timers (to build animations), etc. Have a look here: http://www.javafx.com/samples/ and to the tutorials and see how fast you can build a kind of Google Picasa application... The API even contains some tools to use easily web services: you can find plenty of samples of GUI built in JavaFX connected to some public web services (like a Weather Forecast tool).
And the best... is the deployment part. You can embed your application within an html page, like an applet, and the user can drag and drop the application to her/his desktop to use it whenever she/he wants (without returning to its browser)!
Really, I think JavaFX, at its early stage though (v1.2), is a really good tool and represents the first step for Java toward the next generation of applications: the Rich Internet Applications (RIA).
Java Swing is an established and mature technology for desktop development. You'll be able to find lots of information online and plenty of sample programs. With that said, however, you might want to consider Adobe AIR. AIR is basically a runtime that lets you run your Flex apps on the desktop, and gives them access to local resources such as the file system. I've written Java Swing apps for 10 years and I am amazed at how much more productive I am using Flex/Adobe AIR. One nice aspect of Flex is that you can create your GUIs declaritively, much like how you use HTML to declare the layout of a webpage. It's a much more concise way to specify a GUI, and much faster and easier to maintain than the reams of Java Swing code you need to do the same thing. I wouldn't recommend JavaFX since it is so late to the party and hasn't really gotten with mainstream developers.
You should try them all and see which one fits best with your requirements. If you want to see what you can do with Flex and how to do it then check out Tour de Flex.
Some of the advantages of Flex are that it is mature (over 5 years old now) and a significant area of investment for Adobe. You can also find numerous examples of AIR apps built with Flex in the Adobe AIR Marketplace.
Swing can look good with Substance L&F.
However, if you are developing alone (as opposed to with a team), trying JavaFX might be a good idea.
Please read the about this, write extremely lightweight swing applications and with the same code base move it to web.
demos
runtime
I had evaluated these for desktop application and finally desided to go for JavaFx . This have very good media library and hardware accelerated graphics and media capabilities . With Jdk 7 update 6 onwards contains JavaFx totally I integrated no separate installation is required . Java swing is very good technology and will be continued but I see JavaFx is the future for GUI and Internet application to some extent. Biggest advantage for me was that JavaFx app could be converted to exe files with native packaging
Also try scenebuilder for drag and drop component designer
I feel that I do not have enough information to answer this question. There are many applications in which an AIR approach is a better choice, other applications use other technologies better. I am primarily an AS3/Flex developer, but I know there are many instances where one of the Java platforms is a better choice. Now that Flex is no longer an Adobe product but rather a Apache product, it will either improve the product as the users will create the roadmap, or kill it off completely.
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 8 years ago.
Improve this question
Java is one of the best managed runtime technologies we have. It has very high performance VM which allows to achieve performance close to C. The amount of high quality open source libraries is incomparable to any other platform.
However, despite it was the first dynamic client side technology to appear in browsers (Applets), it isn't used widely now.
What are disadvantages of Java which make people use JavaScript + HTML5 or Flash/Flex instead of Java for RIA? Why should I use them despite they are not as pleasant for a programmer as Java?
"it isn't used widely now"
I disagree with this perception... some examples:
Mindterm is a Java based ssh freeware client supporting ssh2 can be run embedded as applet google for it
Mizu web phone is a Java and open standards based SIP VOIP client which can be embedded as an Applet -google for it-
OpenSignX is an opensource Java based document and form signing Java applet for PKI X.509 certificates. google for it
Coolsmile is a Java based IRC client that can be run as app or embedded Applet
-google for it-
JFTerm is a Java telnet client. Can be run as desktop app or applet. Supports telnet (23), ssl and ssh -google for it-
J3Dworkbench is a Java 3D game-design authoring tool. delivery via Webstart or as Applets
-google for it-
There´s also thevirtualheart dot org a Java based heart simulator
also an applet
or Geocaching browser (JavaFX) at canoo dot com
You cannot do everything in HTML5... for instance take a look at complex apps like JITSI (videocomerencing, voip app) or MuCommander -google it- or Sweet Home 3D, or Art of Illusion... all java-based. Java serves a purpose... and Microsoft and its friends have been trying to discredit it, replace it with something else, and it continues being relevant. ask yourself why. it´s because it serves a purpose and its level playing field software ecosystem is HUGE.
Do a seach of code dot google.com for Java-related projects... and see.
Plus, to the commenter above who says JavaFX has limited appeal let me remind you that Java is NOT ONLY a programming language but actually 3 things: a programming language, a runtime environment, and a level playing field software ecosystem. You can use Java libs without writing a single code of Java language ... using Jython (Python for Java), JRuby (Ruby on Java), NetRexx (open source Rexx on Java, see www.netrexx.org), xRuby (ruby to Java bytecode compiler) or Jabaco (Basic to java bytecode compiler)... just to name a few of the many JVM languages... http://en.wikipedia.org/wiki/List_of_JVM_languages
It can take a lot of work to create a high quality applet compared to the amount of time it takes someone to create a high quality flash application. Building a presentation layer can be tedious without the right tools.
Furthermore, Oracle/Sun gave up on applets a while ago. They still support them but are not actively trying to improve them. Oracle is currently putting all of its weight behind JavaFX. JavaFX is a technically viable solution and has the advantage of allowing you to leverage your Java knowledge. The problem is most web designers don't have much Java knowledge and don't want to bother with it so JavaFX has never been very popular. If a web language isn't popular it can annoy your users when they have to download plugins to use it.
Another thing to keep in mind is that Flash itself is also on the way out. If you're going to be developing and maintaining this project yourself then feel free to pick up JavaFX.
If you plan on hiring a web designer or you want to learn web design skills allowing you to get hired somewhere then your best bet these days seems to be learning a good javascript framework (e.g. JQuery) and picking up some solid HTML5 and CSS3 skills.
Google maps for mobile is a java applet "http://en.wikipedia.org/wiki/Google_Maps#cite_note-20"
I should think that says alot, the question is sort of a truism this prevents a constructive answer the question I'd try to answer is this "is java applets and javaFX widely used" as your question is based on a premise which we cant be sure of how you arrived at it. Java applets work on the web JavaFX on the other hand is more than just for building applets, a GUI isn't just an applet
I can just hope to add to your knowledge and help you re-assess your opinion
the below is from:
http://www.ibm.com/developerworks/web/library/wa-appmozx/
HTML is great for displaying hypertext documents, but terrible for displaying GUIs. Traditional Web-based applications use endless amounts of effort trying to shoehorn HTML into the look-and-feel of a traditional forms-and-menus application. That was never a purpose for which it was intended.
The addition of form elements to HTML (FORM) did little more than create a new way to implement thin-client block-mode applications in the style of the venerable 3270 terminal. Like the 3270, HTML provides batched-up form submission. Character-based applications ultimately gained efficient user-navigation systems, but that was all lost when GUI applications came along. Subsequently GUI applications added back their own navigation structures, using the mouse and widget feedback.
When HTML forms came on the scene, they copied the design of block-mode terminals, but without the tight navigation and without replacing it with a proper GUI equivalent. Under HTML, the user is left to guess which visual elements on a given page might be user controls and which are just decorations. Therefore, for GUI-driven applications, HTML isn't that great a starting point. That's the reason why Java applets were met with such positive market hysteria when they first appeared -- they presented an opportunity to provide a real GUI.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I come from lots of Java programming and weak at JavaScript.I always used component based web-frameworks for web-application development(ZK,GWT,Wicket.etc)
Now we are planing a web+mobile application.I figured out that its better to separate bushiness-logic from UI using Spring MVC/REST/Jason combination.
Next question is mobile framework.I took a look at following frameworks
1.Sencha - Have to program in JS and it will generate HTML5 based applications.
2.Touch4J - Java Wrapper around Sencha?But whats the connections with GWT?
3.Phonegap - Have to write in JS and it will generate "hybrid" applications which runs in a web-view ? Can I host these applications in a web-server?
4.codenameone - Write in Java and it will generate native applications.(are these not hybrid applications as in PhoneGap?)
Any suggestions on this or are there any other frameworks targeting both browser and mobile application development ?
Codename One creates "true native applications" not phonegap web applications, Codename One renders the entire screen and allows you to embed native components in place thus giving you deeper control than you normally get with web applications.
Basically the choice boils down to whether you are a Java developer or a web developer.
FYI I am one of the authors of Codename One.
The Touch4j framework is a Java binding to the Sencha and PhoneGap APIs. The framework relies on the GWT compiler to take your Java code and translate/compile it to Javascript, just like any normal GWT application would.
Touch4j currently comes in 1 Jar file that you include in your classpath, and you basically use it like any other Java 3rd-party API. Since you are in the world of GWT, you get all the perks associated with that: GWT-RPC, debugging, Java's type-safety, etc.
Once you have written your app you can either run it as a web app (albeit without device
support), or you can deploy it to the device. If there is anything specific that you need to do with the device, you can use the Cordova binding included in Touch4j. There are two tutorials that we have in place to do just that:
http://emitrom.com/touch4j/tutorials/hello-android
http://emitrom.com/touch4j/tutorials/hello-ios
If you want to talk to a backend Java service running in OpenShift, for example, there is a tutorial for that, too:
http://emitrom.com/touch4j/tutorials/meet-openshift
If you are a Java developer, you will feel right at home with Touch4j. Version 2.1 was released yesterday, and it includes support for ST 2.0.1 and Cordova 1.7.
Also in the interest of full disclosure, I am one of the guys behind Touch4j # Emitrom.
#Ashika with Sencha framework can you build MVC application and a native look and feel for iOS, Android or BlackBerry or WEB-application. Phonegap IDE can you build native application with JS or Sencha or JQuery mobile fusion all. I hope theses helps. :)
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
Considering that
Sun/Oracle decided to not develop Swing any further after they "invented" JavaFX
JavaFX doesn't really work and some consider it a failure already
the not really platform-independent nature of SWT, the manual task to dispose GUI elements and the necessity to bundle platform-specific libraries
is there another way out?
If I would like to do GUI development on the JVM
with a good API (Swing and SWT are not bad, but they are not really good either.)
which "feels" responsive (still a problem today with Swing and SWT, despite the claims that this is solved.)
which won't be obsolete in a few years
what decision should I make?
Is there even a third option available or a possibility there might be one in the future?
An option
which is fast and responsive (Not Swing's ideology of "If it's not fast, it is the developer's fault")
with native look and feel
with a single library which runs on all platforms
Is this realistic?
Thanks!
=========
To clarify: If I have to start a new software project on the JVM, there are several existing options, like using SWT or Swing, using Swing with third-party libraries like SwingX, JIDE, JGoodies, Flamingo or using application frameworks like Netbeans Platform or Eclipse RCP. Is there a supported/suggested way which weakens the pain normally associated with Java GUI development?
The answer is prefer swing, I think.
since 1.4 there are big progress on awt (sun do that because java fx need awt, fortunately)
since 1.5 big progress in thread managment (SwingWorker and concurrents things)
swing is excellent, responsive (what the problem with developper fault ? ), native l&f, and so on
there are excellent libraries, like swingx, trident, etc, and platform, like netbeans.
Of course it is a mature technology (a little old), but I know nothing else. It will be cobol of GUI development :-)
You won't find an objective answer to this question, only personal preferences and options.
SWT
My personal preference is SWT. I started using it, when Swing was to bad to be an option. SWT is "just" a layer on top of the native windowing APIs and thus applications written with SWT feel like natively written applications. Those can also be screwed up. No API will ever be safe from bad developers. The performance is as fast as it can get in my experience. If it is not, there is another way of implementing it, where it will be.
SWT's API is very low level which makes implementing basic stuff unexpectedly tedious, but fortunately most typical usecases can be solved with JFace, which improves the situation. And when you use the API for a while you'll accumulate your own util classes. You can become pretty fast in implementing SWT tools.
Since SWT gives you only the basics, you need MigLayout and Nebula widgets to survive. You might like Glazed Lists.
Qt Jambi
Actually I would have liked to include another option besides SWT and Swing for you: Qt Jambi. But Nokia gave up on this, and it is "maintained by an open source community" now. So I don't know about "not being obsolete in a few years".
Nevertheless I am excited by this ongoing discussion. Some people have written an SWT implementation using Qt Jambi as "native" API. They are trying to figure out how to contribute it. Having Qt as an option might enable your "single library which runs on all platforms" for SWT one day, though I wouldn't count on it anytime soon.
But for me your requirement of "a single library" is not such a big issue. Use maven for your builds, add a few lines of configuration and you'll forget about this very soon.
Swing
I can't really compare SWT to Swing, since my experience with Swing is limitted. As a user I don't like most Swing applications, but I did see some beatiful ones.
Nowadays the native look and feel of Swing apps got pretty good, but you won't fool a power-user. Also performance seems to be really good in new and well done Swing apps, but again, this is only from my limitted view as a user.
Obviously there are more 3rd party extensions for Swing than for SWT - just do a Google search. (But then again, if you endure the pain of learning Eclipse RCP you'll get an huge, interesting infrastructure as well. That's not talking about widgets though, that's stuff like EMF or RAP. I am no Eclipse RCP person - I never had enough patience for that...)
A really big advantage for Swing, if you like that stuff, is Matisse, the GUI builder of Netbeans. Qt has also a well done GUI builder by the way.
Summary
If you plan for long term, I don't see more options than SWT or Swing for GUI development in Java. Both are good enough to satisfy most needs if you spend enough time. But they are not perfect. You'll always envy people using other languages for their widgets, implementation speed, tooling, ... If you are not bound to Java, you might even prefer Flash or Qt.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I come from a few years experience in .NET, and played a bit with
Java during my uni studies.
Could you recommend any good books to learn the best ways to
develop a Java web applet?
There is a good SUN tutorial on Applets here.
I wouldn't put applets at the top of the list of Java EE technologies to learn. They were very important when Java first came out, because they made the browser dynamic, but they aren't as important now.
I'd say that the best approach is to start with servlets, JSPs using JSTL (Java Server Pages and JSP Standard Tag Library), and JDBC (database access). You can go a very long way writing web apps just with those technologies.
Just a suggestion, but the documentation on Sun's Documentation Site and their Tutorial sections offer a lot of good information that'll put you on track with their core functionalities. I'm currently taking a Java course at my local college, and I refer to the API website & documentation sites more frequently than my book.
The use of Applets has declined, especially, in light of newer technologies like Flash. However, you still see some use of Java Applets. For example Facebook has an Applet to help you upload photos.
There is quite a push to re-invigorate the Java applet technology, and most of this push comes from JavaFX. JavaFX is a scripting environment which offers many of the features which has made Flash so popular. JavaFX runs on top of Java's applet technology, but uses it's own graphics run time instead of Swing.
Most books on Java applets were written pre-Y2K. The few up to date books on applets are mostly written for non programmers. See the books by Elizabeth Boese for example.
If you want to take up learning JavaFX (which will teach you a bit about applets), I'd suggest reading Pro JavaFX™ Platform.
If you're developing applets, you'll inevitably be better off starting by learning to develop using the swing api. I'd suggest pulling down the netbeans ide, and create a swing ui in it (you'll feel pretty comfy with this if you have experience with winforms, etc.) It's not hard to turn this result into a webstart app or applet. I'm partial to netbeans because of it's excellent ui builder's integration with the matisse layout concept.
If you're interested in an asp.net (ish) framework for developing web applications, take a look at Tapestry. It's not identical, but a lot of the concepts are the same (you extend a page object, you make reusable components, etc.)
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
For "best" I intend that the code shouldn't need, or need very few, platform specific tweaks.
I strongly recommend Java for cross-platform GUI development. In particular, I recommend the GUI builder that comes with the Netbeans IDE. It's very simple and very powerful. You can point and click and drag and drop to create a GUI, and easily customize the actions which various buttons and other components take.
I much prefer Python as a language, but none of the free tools for GUI development come anywhere close to this, and the same thing seems to be true for the other languages I've used. (I should point out that QT has wonderful GUI developers for various languages such as C and Python, but it's only free when used on open source projects.)
EDIT: QT has recently been relicensed as LGPL, so you're free to use it in commercial applications. The Python bindings for this (PyQT) have not been re-licensed, but another project called PySide has been created to provide Python QT bindings.
I personally despise the whole concept of emulating the native GUI that is where the Java GUIs are rooted. Instead of being at home wherever you go, it makes you a tourist everywhere, often needing an interpreter. The Eclipse GWT is a better toolkit that makes much better use of local resources, but it still holds that people love to write Java code, and hate to use Java applications, think of it: which Java applications you love on your desktop?
Tk is just as ugly and limited on any operating system you choose to run it onto, and the same goes for Qt, in my opinion.
Mono would need a good try, as it is a way to answer the question "why Linux sucks", if you remember that old post bi Miguel de Icaza. Mono comes with a mature set of widgets and Apis and does not try to limit what you can do in order to give you portability.
Silverlight is close to portable and has a great interface definition language, but lacks access to the system, you have to split the application between a server and UI even on the same machine to overcome it.
Adobe AIR is a dog and local system acces is not easy.
If I am able to choose, I tend to avoid GUIs altogether and try to use a web server, even a local web server, and Json, JQuery and all that stuff. I found out that I can have many more choices and am more productive than with native widgets. This combines the strengths of the use of a real language server side and the wonderful disordered geniality of JavaScript in the GUI.
Yes: use Eclipse RCP. You can write not only cross-platform, but e.g. multilingual applications with it. SWT provides the native look-and-feel for multiple platforms and windowing systems.
So as I understand it, there is currently NO truly cross-platform high level language & GUI toolkit right now.
Java is cross-platform, GUIs in both SWT and Swing can look good, when you really try hard to tweak them pixel-precise and provide modifications to the look to supported platforms. There are currently some good GUI designers, but nothing as great as OpenStep 15 years ago.
QT is now LGPL'ed so long as you only link to it dynamically. Well but QT has its own set of problems and is a superset of C++. You have to compile against QT-hacked compiler, not the generic C++ one.
didn't try the wxWidgets, but from the looks of it, it can work, but is NOT high level toolkit at all!
There seems to be an option to write in C# and opensourced .NET and run it via Mono in other platforms than Windows... Didn't try, but it seems to me, that is just porting Microsoft on other platforms.
There is GNUstep, but for now it looks for me, like it is only developped by some opensource geek fans. It would be really interesting to see the OpenStep stack outside of the Mac OS X, but for now this looks to me as not viable.
Even Java, while it is self-contained, does not currently provide great GUI designer capabilities. I used the GUI designer tool once when starting to learn how to code with SWT, and now I find myself coding it by hand, which is really not bad, but it really should not be necessary. But that was few years ago, I will have to try again.
You can of course create your cross-platform application core and service code in one language (Java, or C/C++ if you want speed), creating something like a server or unix tool and just connecting to it from the GUI that you create on each desired platform using its own tools. The result is that the GUI is platform native, taking advantages of the features of the platform, and should be fairly simple to create for each desired platform. (Cocoa on Mac and .Net on windows provide rich features for the platform they are native to).
We will have to look into the robustness and matureness of such ideal solution. It should have good commercial and comunity backing and be fairly evolved right now, so as the future implementations of such tools will provide us with more than the mere LOWEST COMMON DENOMINATOR for all the supported platforms, but to leverege the cross-platform tools to include and adopt well-designed concepts and rich features native to the relevant platforms and distribute them cross-platform.
Only than can be cross-platform development truly viable and adoptable in great numbers.
Suggestions?
Java is certainly nice, but I've been doing just fine with Python and Qt via PyQt4 lately. I find that I get things done faster than I did in Swing or SWT, too.
So far, no platform-specific tweaks have been necessary, and Qt4 widgets look nice on different platforms. The Qt GUI builder is very nice, and using Python has enabled easy integration with some other cross-platform frameworks (notably VTK, scipy-cluster, and some SWIG-wrapped objects for interfacing with files output from a performance tool).
Note that Qt is not free unless you use it on open source projects.
As long as someone defines "platform independence" correctly, Java is the best.
Some people argue that C# is the best, but those people seem to misunderstand the term
"platform independence" ;)
Note: I refer to the fact that C# is ported to Linux/Unixes only as long as Microsoft and Novel keep up their treaty. The community itself would never be able to maintain such huge platform as .NET
These days there are many languages that allow you to create cross-platform GUI applications efficiently. Java, Python, Tcl/tk, C#...
I think you need to define the requirements of your application a bit more, for instance:
Will the UI be Web-based, or desktop-based?
Is the application going to be a large or a small?
Will it feature some sort of "extension" feature (e.g. plug-ins)?
Will it function over a network, and is it likely to be distributed/load balanced?
The list can go on forever, work out the defining points about your application, and start researching the language based on the whole.
I would also consider Mono as serious contender for platform independence and a good IDE tool.
Java's performance sucks on the desktop. Just check http://www.codeproject.com/KB/dotnet/RuntimePerformance.aspx
For native binaries, wxWidgets is a convenient solution.
I would tell you that is even better than Java for the user experience side. Even though you can make the presentation layer look pretty much the same for all platforms in Java, they all look like Java. On the other hand, wxWidgets make the user feel like a platform specific build (and it is, indeed), but you can use the same code to compile for several platforms (at least the major ones).
I would think that it depends on what kind of platforms you plan on targeting. Java will have the most platforms with a VM. However, if you just want to use Windows and Linux, you can use C# (using mono on linux).
Based on your definition, no. Even wit the newest graphical libraries you can expect to do a bunch of testing on different platforms.
Flash would probably be the best. Wide spread and better at looking the same across different platforms.