Related
There are a lot of Java "application frameworks" such as those listed in http://pivot.apache.org/demos/ which pretty much all use Swing as the GUI toolkit, or in the case of Eclipse, SWT.
However I have not seen any obvious frameworks for JavaFX. Why is this?
If looking at the "Hollywood Principle", where the framework calls you, I would think JavaFX already does this, but then I'm confused because it would seem Swing and JavaFX do mostly the same role, which is as the GUI layer. But they both do event loops and callbacks/events/observer patterns, etc.
Does merely implementing an event loop and calling your event handler not qualify as an "application framework"?
If not, are there any frameworks based on JavaFX directly (rather than embedding JavaFX in a Swing control)? What would such a framework provide that JavaFX standalone does not?
Sorry for the "obviousness" of this question, but it's not obvious to me.
thanks.
There are plenty of them looks like your research has not been very thorough
http://efxclipse.org/ - in fact it leverages the same core stuff than the Eclipse 4 IDE / RCP 4 but replaces the SWT layer with JavaFX
http://www.jrebirth.org/
http://www.drombler.org/drombler-fx/
http://jacpfx.org/
As I'm the author of e(fx)clipse I'm biased but I know first hand that it is used on (big) commercial projects
In my opinion, Swing, JavaFX and also SWT are graphical toolkit, providing a set of basic widgets. There are not "Application" frameworks because their main goal is to display an User Interface. But you can use them to build an application without any other library by using basic features.
A good sample application can be found here: https://github.com/angelicalleite/museuid
It looks really nice with data picked from a mysql database, but if you read carefully the source code you can notice that all SQL queries are performed within the UI thread which will slow down the UI responsiveness.
This is one of the reason you should use an Application Framework.
Their goals vary and are numerous but they all are dedicated to ease your application development by keeping complex things (like multithreading, messaging) out of your application code.
Your choice shall be done according to your personal convictions about architecture and dependencies you want to use (or don't).
I'm the author of JRebirth (disclaimer), but I sometimes have a look on other frameworks, so you can make your choice by asking yourself some basic questions:
Do you want/need OSGI support ?
=> Yes efxclipse, DromblerFX, DEMUX
=> No JRebirth,JacpFX, DataFX, griffonFX, afterburner.fx
Do you want a minimalist framework?
=> Yes afterburner.fx
Do you want/need event messaging?
Do you want to share code?
Do you want modularization?
Do you require Java 7 support ?
How do you want to manage your application threads.
I certainly forget a lot of questions.
In fact you SHOULD use one of these Application Framework (building your own will be time-consuming), it will defintely speed up your developments and secure them, the remaining questions are :
What AF will fit your needs ?
What AF will be convenient to use for you and your team ?
Choosing an AF using patterns you don't like could be painful, in any case you can contribute to any available AF because they are all open sourced.
Hope it helps,
The simple answer to this is: JavaFX is much younger than Swing - at least as a standard JDK library. As a matter of fact, it only became a "real" standard part with Java 8. If you check the history, you see the following facts:
Before JavaFX 2 (released 2011), developers needed to learn a scripting language.
Also before JavaFX 2, the implementation aimed at being platform independent and therefore made no use of system-specific resources which can make a big difference in graphics and animation.
Read through it, and you'll find some more interesting details which can be summed up in that probably most developers have only been "seriously" noticing JavaFX within the last 5 years or so. Swing goes back much further (especially as being baked into the standard Java Runtime Environment), so naturally there are far more libraries aimed at Swing than at FX.
I saw some other similar questions on this topic here but they were not very helpful so I a posing this question.
What is the fastest way to convert a reasonably sized, simple web app to a Java desk top based client targeted for pc and mac? Unfortunately I can not share a whole lot of details about the app here due to various reasons. The most complicated UI in the app though is a page that contains a multi level threaded discussions (please see here for an illustrative example of what I am talking about.) The current web app is based on python so I can not re use anything from the server side code (dont think this is an issue)
I have never done any swing or awt or any other Java based thick client GUI work. My thinking is more or less defined by web based applications. I am capable of doing end to end web app development (including backend and decent UI using HTML, CSS and JS) using Java or python. For your answers please focus on Java solutions only.
So here are my questions
What is the best framework or tool I should use? I found some of the following tools on the web as part of my research.
Awt - does not look like this is a good choice.
Swing which I believe is bundled with regular Java SDK/JRE. - This may be my best
bet.
SWT which seems to compliment Swing in some fashion.
Griffon based on an article here. This framework uses Groovy ( I
have no clue about Groovy, btw) Adobe Air flex. Any open source
frameworks?
What are some of the other issues that I need to keep in mind? Some that I would like your comments on are:
How does the fact that it needs to be deployed on the client complicates things? Since we are using Java, I believe this to be a non issue. I am aware of the usual trade offs between a web based app and a desktop app (e.g. ease of deployment and upgrades etc etc.)
How easy is it to create a one click installer and bundle the app and the environment needed - eg. JRE etc?
The product needs to work on Mac and Windows. Does that complicate things in any way (Again, since it is Java I am assuming there are no gotchas but would like to be forewarned if there are any)
What is the framework or technology that may be good to have on the resume as a skill set?
My deadline is a max of 2 months - would that be enough for a reasonably simple web app given that I need to learn all of these technologies? I am just trying to get a sense here - I know it is most likely impossible to give an accurate answer - just assume I am smart enough and can pick up any unfamiliar tech stack fast enough.
Thank you!
GUI toolkit
Given "Mac and Windows", I'd say that settles my recommendation as "Swing" (perhaps with SwingX1).
I agree with your assessment of AWT. It does not support formatted text in any component out-of-the-box. It also lacks trees, tables (and other components) & people with recent experience using it. Note though, that it is also "bundled with regular Java SDK/JRE" just like Swing, it is just that it is older and less enabled than Swing generally.
If anything complements Swing it would be SwingX. SwingX is built on Swing and provides advanced controls that are not available 'out of the box' in the J2SE.
Swing and SWT are mutually incompatible - use one or the other.
I have no experience with Griffon.
Swing is the most used of the options outlined, so for getting help (ignoring other potentially important factors in the decision), it would be a good choice.
Note 1) Add SwingX if they have any groovy components that present threaded conversations easily, but I suspect a JTextPane would suffice.
Deployment
As far as deployment goes, that is a little more tricky than it seems. Many desktop computers do not come with Java as standard. Those that already have it, might have an old version.
To ensure a JRE of the right minimum version to run the app. is available, use the deployJava.js (mentioned, with links, in the JWS page below).
To provide a 'one click' launch experience for the user, look to Java Web Start.
Cross-platform gotcha's
Unfortunately, though Java is x-plat, there are plenty of things that programmers can do that stuff that up. E.G.
Not accounting for the platform default:
File encoding (file.encoding2)
Line break (line.separator2)
File separator (file.separator2)
Coding fixed size ('absolute layout') apps. that will be shown as different sized apps. on other OS.
...
Note 2. That is showing the property to use for each.
Timetable
Obviously I cannot speak for you, but I can tell you that I would have had no chance of going from 'which technology' to a 'deployable app' within two months.
Hope you're more capable than me! ;)
You said that you wanted a Java solution, but be aware that there are plenty of Gui options in Python, and you already have your web application written in Python.
Groovy is a different programming language than Java, but Groovy runs on the JVM. Do you want a Java solution or a JVM solution? I ask because you mention Griffon.
Assuming you want Java, I think your main options are Swing, SWT, JavaFX 2, and Apache Pivot. Oracle has said that they intend for JavaFX to replace Swing as the GUI platform of choice. That said, JavaFX 2 is in its infancy, and only a preview release is available for Mac right now. The upshot of JavaFX and Apache Pivot is that you could use the same code for your web application as your desktop application.
You can try doing so in small steps:
* As a first step you can create an applications with SWT and embed your application in a browser control.
* Then you should move pages and some controls from the web app to the desktop one by one.
In this way you can get a minimal application in hours :)
P.S. If you want an iOS app with this approach it's worth looking at this open source project: http://en.wikipedia.org/wiki/PhoneGap
I've been away from Java programming (except some Android dev) and desktop apps but now I want to develop a Java desktop app as a personal project. So I wonder, what's the current blueprint for this kind of app? Is still Swing and JDBC?
Having said that, would also recommend that set of technologies for a simple project? As an analogy, I don't want to read a 800 pages book on J2EE just to do a simple web page, if you know what I mean.
Thanks
Do a little prototyping and choose:
Swing: Most resources, most used, lot of 3rd party free stuff (SwingX etc.), kick ass look and feels, really cross platform, nice IDE support. Swing is going to be improved in next JDK release, so it's still pretty much in game. NetBeans IDE and IntelliJ IDEA are written in Swing.
SWT: Alternative which uses facilities of operating systems on which it is implemented. SWT community is smaller and it doesn't provide that many tools as Swing does. It's a little more tricky to do cross platform, you need to make actual comiplation on all OS you are going to ship your app on. Eclipse IDE is written in SWT.
QT: Cross platform solution with lots of users. It's pretty popular amongst C++ users. On the other hand, I've never seen powerful tools for Java+QT as for Swing or SWT. I don't consider QT as "true Java" solution, but you might have different idea.
Java FX : Since 2007, Sun tries to persuade us to use this declarative approach for building RIA. I've seen lots of tutorials but I never liked Java FX and I am not alone at all. JavaFX tries to be only UI solution, it does NOT replace Swing.
There is probably much more, but this is what I tried. From those, I liked Swing. It's pretty mature now. There are bazillion of tutorials over here. Yes, some things are pretty painful with Swing, but overally I think it's still best desktop choice for Java.
Another intersting thing, if you're into declarative UI, is YAML. Check this pdf book.
As for second part, JDBC is still pretty popular, but you might think of some ORM framework (you can easily google some or looke here on stackoverflow, most popular one is Hibernate).
I need an advice for cross-platform engine/framework for desktop PC application development (Windows, MAC, Linux). I see 3 possibilities, Qt, Java and Adobe AIR.
It must be easy to install (run-time is a drawback, but C++ wrapper and/or installer can solve the issue I think).
It must be fast and have a rich GUI (not 3D game, but definitely some 2D graphics).
The development environment must be easy to establish and the UI development tool must have drag&drop functionality to define application layout.
Target application must have native look and feel. The professional paid support should be available.
All of these criteria are met by Qt, with the exception of "native look and feel". There is no such thing as a cross-platform framework with native feel, especially on OS X, where users are very demanding about the "feel" of applications. If you really want native look and feel, you are best served by writing a shared framework in C++ or C# and then providing native GUI on each platform (you can use MonoMac to provide a native Cocoa UI using C# instead of the native Objective-C, if that's your cup of tea).
That said, we've been very happy with Qt (and the Commercial support) for cross-platform development. Particularly the new OpenGL accelerated 2D Scene API makes animated UIs quite easy. QtCreator is a decent IDE with visual designer support.
Contrary to others, probably due to the fact that I worked on a real-time trading Swing application, I consider Java to be the best answer to your requirements (however, i consider this question as subjective, as previous answers already shows). Let me develop.
It must be easy to install (run-time is a drawback, but C++ wrapper and/or installer can solve the issue I think).
Using Java, you can rely upon Java Web Start, which is, as far as i know, the best solution for easy to use applications : you click a link on the browser, and the application is installed in start menu/desktop and started as soon as it is downloaded. Seems like Adobe AIR offers an equivalent feature, but to my mind Java Web Start integrates, due to the deepness of its ecosystem, far more powerfull distribution solutions (like, as an example, the easy ability to generate the .jnlp file on demand).
It must be fast and have a rich GUI (not 3D game, but definitely some 2D graphics).
Contrary to most popular belief, generating good graphics in Java is possible. Take as an example a look at excellent filthy rich clients companion site of the excellent book.
The development environment must be easy to establish and the UI development tool must have drag&drop functionality to define application layout.
Eclipse is a defacto industry standard for IDEs, and it integrate multiple DnD IDE builders. I would simply take as example the recently liberated Windows Builder Pro.
Target application must have native look and feel. The professional paid support should be available.
Well, Swing default look'n'feel is indeed a little different from system one. however, there are excellent third-party ones, listed here, as an example.
Finally, some examples :
the excellent Palantir Technologies blog list some outstanding Swing applications
Gephi is a rather complete and efficient high-volume graph viewer
My previous work (don't consider it as a masked ad, it's only a way to show some rather solid Swing).
I would not recommend Java for desktop development. I do not care what other say, Java is still slow compared to native languages like C++. I would go with Qt. The IDE has a GUI builder and can be integrated into Eclipse or Visual Studio.
Here's a helpful resource:
http://qt.nokia.com/products/
Have a look at Appcelerator Titanium: it basically wraps a web app in a browser. You can have anything you want in a GUI using wen tech, but it looks like an ap[p.
Strangely, nobody mentioned Real Studio (now Xojo) which does meet all your requirements:
It is easy to install and does not require a separate run-time
It compiles to native code so is reasonably fast
It has a good UI library that is native for each platform
The IDE is very nice with drag and drop UI designers
Target applications are fully native and use native controls
First of have to mention http://wxwidgets.org/ , one of the most popular X-platoform frameoworks. Depending on the complexity of your application and the requirements to the "nativeness", a cross-platform framework may work for you. The x-platform applications built with framework usually feel a bit "alien", especially on the Mac, but workable. A good example is http://taskcoach.org/.
If your users are tolerant to hearty download sizes, hefty memory requirements and a bit of non-native look-and-feel then plain Java, eclipse RCP or NetBeans platform can work for you. You may save quite a bit of development time going this route.
However I am not aware of cross-platform framework that satisfies all your requirements.
If you need to get to a production-level application, the strategy that I have seen worked best was to stay native but split the UI-dependent code into cross-platform (e.g. C++ business logic) and UI. This way, you will use native interface building tools (each platform has something good there). Depending on the complexity and "finish" requirements of your application you may actually save time going this route.
A great overview of the "Native X-Platform" process can be found in this answer by Chris Hanson.
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 3 years ago.
Improve this question
We're starting to think about the next stage of our company information strategy.
At the moment various departments have Delphi VCL applications that focus on the information that they manage about their Projects. Behind the scenes we've been making sure that the thinking joins up.
We're now at the point where we want to give people the opportunity to browse all the information the we have on either a Project-by-Project basis or search aspect.
We think it will be a web based interface (at least intranet) but are stuck on what to write it in!
Options seem to be Java, PHP or Ruby. Any of the above will involve us learning a new language (no budget for new hires) so we're looking for guidance
You should understand the pros and cons of as many languages and frameworks that you can. I happen to know all three (PHP, Java, and Ruby) and have written many applications in all of them (plus others), but I drastically prefer Ruby. I'm not sure I would appreciate Ruby as much as I do if I didn't have experience in other languages.
Why learn a new language at all? Since you're Delphi developers already, use Delphi. It has VCL for the Web (formerly IntraWeb), which gives you the ability to create pretty good web applications with almost the same functional capabilities as a Delphi Win32 application. IntraWeb (under either name) works like you're used to, right in the IDE, and lets you write Delphi code just like always. It's a viable web solution, especially for shops that have lots of Delphi code already; much of the business logic can be used as is, if it's not tied to the GUI.
You didn't mention what version of Delphi you're using, but there are demos of VCL for the Web or InterWeb in both Delphi 7 (%DELPHI%\Demos\IntraWeb) and Delphi 2007 (C:\Documents and Settings\All Users\Documents\RAD Studio\5.0\Demos\IntraWeb\Win32 on WinXP). Delphi 2009 puts them in yet another location (C:\Documents and Settings\All Users\Documents\RAD Studio\6.0\Demos on WinXP). I'd start with the Features demo regardless of where it's located on your version of Delphi, as it gives a good overview of the capabilities.
Disclaimer: I am in no way affiliated with IntraWeb, VCL for the Web, or CodeGear/Embarcadero. Just a Delphi user since 1995.
I don't believe that there's any huge advantage in either one for what you are trying to do. Plenty of people here will support each option (hopefully without a flame-war).
As none of them are familiar why don't you try creating the same tiny prototype in all three and see which you prefer? Your best option is to pick a framework from each and base your efforts on those eg. CakePHP, Ruby on Rails, GWT etc.
By far the biggest hurdle you're going to face is learning about how to build web applications whatever technology you pick - the paradigms are quite different to a traditional thick client apps and while this isn't insurmountable I'd recommend hiring somebody with a web-app skill set if only to get you up and running.
Coming from a Delphi background you'll probably feel more comfortable with Java as a language but I've managed to avoid PHP and not used Ruby so can't really give a fair appraisal.
What I would say for Java is that once you've got the basics of web development down it's incredible powerful, allowing you to build code in a structured way with distinct layers and separated concerns.
There's also a huge wealth of open-source APIs, which these days allow you to focus on the business problems, simply picking and choosing libraries that support your solutions. Also throw into this mix the support for automated testing and you've got a powerful combination in Java.
Although I don't particularly like the language, PHP is probably the easiest to learn. Ruby would not be far behind, although I have no experience with it.
Java, although I love it, is extremely difficult when it comes to setting up and maintaining a web interface. Too many intricacies with XML files, JSPs, Java files, ...
Of course it's all very personal, but PHP doesn't have a steep learning curve like Java with its related web technologies.
After installing, you can get productive almost right away, even if you hardly have any previous knowledge of the language. I think that's once of the main reasons for PHP's popularity.
create a new file with notepad
type: <?php echo "hello!" ?>
save as hello.php
now access it as http://www.yourserver.com/hello.php
And you'll see Hello!
That's it.
The web is full of examples and documentation, and it's really easy to integrate PHP with databases like MySQL. I oftenly use MySQL as the glue between my Delphi applications and websites.
Ruby (on Rails) is quick to learn and it has great community support. Now that I've become comfortable with it, I would not write a web app in anything else. My only negative experience with rails is when DHH rejected my friend request on Facebook - c'est la vie. ;)
The hardest part of web development is the new paradigm. The next hardest part is picking the right framework. I would add two languages to your considerations:
Python (with Django)
ASP.NET
In many ways the Microsoft stack will certainly take a lot of potential mistakes off of your plate, in that it gives you a lot of the framework decisions in a nice package. Of course, you may not like the whole package. Ruby on Rails is kind of the same thing in that respect (giving you the package, that is, but not as much as Microsoft).
But regardless of your choice, the just as important (with the exception of PHP since it is a web language to begin with) is the web framework.
And an important driver in your decision should be the size of the project. A small project won't shoot itself in the foot too bad even on poorly written PHP, but a very large project can certainly get very messy in a dynamic language when everyone is learning it for the first time. It depends on the type of team you have.
given the options, i'd go for ruby ... mostly because it is such an extremely beautiful, powerful, expressive, consistent and radical language ... you can get a very good introduction here ... plus ruby-on-rails and merb (which are united in rails 3) are very productive environements/frameworks to develop apps ... i personally don't know anything which is so suited for fast developement of server driven applications ... also ruby is very good for scripting ...
there are many things i dislike about PHP and Java, but let's not get into details ... my main accusations would be, that Java is quite verbose and bloated, and the most used frameworks even more so ... and PHP has a terrible API design and quite a lot of semantical inconsistencies, even some syntactical, although most of the latter are getting resolved recently ... plus, it is not very fast ... and also, you get many downvotes on stackoverflow, when you critisize one of the languages ... :D
however, a reason to use Java is the massive ammount of tools available (allthough only a part of them is relevant for the web) ... when it comes to PHP, the best thing is deployment ... it's very easy to get PHP running on a server ... and most servers have PHP anyway ... so if you want to write software, that can run on many servers, PHP is the best choice ... if you decide to use it, do yourself a favor, and use it only with a proper framework/environment, as Flow3, Zend, synfony, codeigniter or CakePHP ... PHP makes it easy to hack together some code (i'd even dare to say it was kind of designed for that) ... but you'll quickly regret that you relied on that ...
the microsoft stack was already mentioned as a possible alternative ... up to you to decide ... it's good, but expensive (licenses make scaling much more expensive) ... and IIS has relatively much downtime compared to other servers ...
personally, i'd suggest you use Haxe ... a very nice and expressive language, that allows you to compile to
AVM1 or AVM2 bytecode (virtual machines for flash player 6-8 and 9-10)
neko bytecode (neko is a very fast and lightweight virtual machine, suitable for writing web servers, daemons or desktop apps)
JavaScript source code
ActionScript 3 source code
PHP source code
C++ source code (using neash, you can use flash player API with C++, most notably the display/graphics API, which is very easy to use)
Java source code for android (currently prealpha, but demo looks good) ...
you use a single language to
write servers (be it HTTP or TCP)
create rich clients (be it javascript or flash)
target smartphones (either flash smart phones or iPhone through C++ (well, still not optimal, but progress is being made) and, in near future, Android ...
build desktop apps
on top of that Haxe is an open source community driven language ... plus of course Haxe has a very consistent OO API design and provides many cool languages features, such as high order functions, parametrized enums, generics, and structural subtyping ... and if you decide to use it, be sure to check out haxelib for helpful frameworks/libraries ... ;)
I think you should choose between Python or Ruby. Both have similar capabilities, with relevant frameworks. I think it's largely a stylistic preference, so you should spend time looking at the syntax of both languages.
Since you weren't initially considering Python, check out this video on the Django framework: http://video.google.com/videoplay?docid=-70449010942275062
From a pragmatic standpoint, Java probably has the most power and flexibility, PHP is probably the most widespread but tends to encourage bad coding if you're not careful (I have yet to see a PHP app where I said "Wow, this code is pretty"), and Ruby/Rails is easy to learn and really fast to develop on, but everything is pretty much decided for you (not necessarily a bad thing) and when you step away from the "Rails" way of doing things, it can get messy.
If you're looking for easiest transition from Delphi, consider Flex.
It has the same RAD interface-builder that you're used to in Delphi, it's backed by object-oriented ActionScript and since your site is internal you can mandate using Flash on all client computers.
Besides, Flex rules. Really)
Going from Delphi world to web world? Use C#, since there is a spirit of Delphi in C# (all right, this spirit is Anders Hejlsberg). When learning C# I found a lot of concepts similar to Delphi.