Is Java the best language to develop cross-platform GUI applications? [closed]
Asked Answered
P

11

33

For "best" I intend that the code shouldn't need, or need very few, platform specific tweaks.

Pazit answered 23/12, 2008 at 14:55 Comment(5)
Downvoting is a little harsh. Just not upvoting it would have been sufficient, methinks.Eladiaelaeoptene
@Tom Hawtin - tackline--I agree; another good reason to downvote the question.Anteversion
Gotta agree with Andrew: downvoting this question is a bit harsh imho.Zygophyte
"Which is best" is not far from being unanswerable--adding the "in terms of code changes" caveat doesn't improve it much. I stand by my down vote--this kind of question shouldn't be rewarded with higher rep.Anteversion
#234575Emplane
C
23

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.

Cog answered 23/12, 2008 at 15:0 Comment(7)
I also recommend Netbeans. Its GUI Designer is so great I can compared it with Visual Studio.Radioactivity
How good is it compared with Intellij Idea? I've heard very good things about NB, but I haven't found a direct comparison with IDEADoloroso
I've never tried out IntelliJ because of it's non-free nature, so I'm not sure, although I've also heard excellent things about it.Cog
@Eli - Does the end user need to install Qt on their system in order to run an application developed with Qt?Gavingavini
@Usagi: Depending on how you deploy your application, a user wouldn't necessarily need to install Qt separately, since you could bundle it with your application.Cog
@EliCourtwright , Do you still recommend to make gui app with java now?Ginger
@Becauseihatemyself: I've moved to developing webapps rather than desktop GUI apps, both in my career and in my personal projects. While it does require a server, it avoids a lot of "dependency hell" issues.Cog
V
5

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.

Voyles answered 24/9, 2010 at 8:38 Comment(0)
G
4

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.

Globate answered 16/4, 2009 at 23:42 Comment(0)
P
3

So as I understand it, there is currently NO truly cross-platform high level language & GUI toolkit right now.

  1. 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.

  2. 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.

  3. didn't try the wxWidgets, but from the looks of it, it can work, but is NOT high level toolkit at all!

  4. 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.

  5. 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?

Pestilence answered 24/9, 2012 at 4:51 Comment(3)
Is this an answer or a question?Gradualism
"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." Huh?!?! Qt is a set of C++ libraries. Do not confuse qmake with a compiler please. Qt libraries alone can be build from source with gcc, visual c++ etc. compilers and accordingly can be used with any application compiled with those. I didn't bother reading the rest of your post because of this nonsense...Inanna
@Gradualism , if it's an answer it's a pretty incorrect one LOLInanna
G
2

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.

Gogol answered 23/12, 2008 at 14:59 Comment(0)
M
2

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

Muslin answered 18/5, 2009 at 14:4 Comment(0)
S
1

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.

Specialist answered 23/12, 2008 at 15:9 Comment(0)
B
1

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

Batsman answered 3/9, 2010 at 19:9 Comment(1)
With regards to java applications start up time: nice to have but you do really need your application started in 15 ms ? I think that 1/10 of second is fast enough... There is always a possibility to compile java code to native code.Philippopolis
M
1

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).

Marchak answered 14/12, 2011 at 14:22 Comment(0)
G
0

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).

Glossography answered 23/12, 2008 at 14:58 Comment(1)
First confirm that you can get, and continue to get, Mono for any platform you customers might wish. Many major distros don't supply anything past Mono 1.2 or 1.9, with Ubuntu 9.10 and SUSE as exceptions.Selwin
B
-3

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.

Byline answered 23/12, 2008 at 14:59 Comment(2)
I’m not sure about today’s Flash’s performance but some years ago scrolling a list that was several thousand pixels high was anything but fun. :)Radian
Some years ago Java GUIs used to be pretty terrible too. Hardly a useful fact, several versions and a generation or two of hardware later.Abigail

© 2022 - 2024 — McMap. All rights reserved.