You are not logged in.

#1 2009-10-19 02:54:38

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Is Java the only real way of doing cross-platform GUI

I'm planning a project that will involve some GUI-centric work (its essentially a spreadsheet with some functional programming features). I want to have it be cross platform because I would like to build it as a tool for first time programmers. I haven't really done much GUI programming before but from what experience I have, it seems that the JVM with Swing is the the least painful for the user. I've had some experience with Python, but can't find something that works equally well on all platforms without the user installing a lot of stuff. I've also considered going the JavaScript+browser route, but that's not something I'd like to tackle. Any other ideas?


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#2 2009-10-19 03:33:55

iza
Member
From: Toronto, Canada
Registered: 2008-12-31
Posts: 44

Re: Is Java the only real way of doing cross-platform GUI

wxWidgets?

Last edited by iza (2009-10-19 03:47:03)


\_\__     __/_/ 
       (oo) ______
       (__)\           )\
              ||‾‾‾‾\|

Offline

#3 2009-10-19 04:52:21

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: Is Java the only real way of doing cross-platform GUI

JVM with swing is the most painful for the programmer.

You've already explored these, but I'll suggest them anyway:

wxPython really isn't that hard to distribute. On Linux, the package is available for major distros, and for Windows and Mac you can make binaries that bundle it.

I mostly write Javascript + browser these days because I think that's the way things are going in the future. But I hate Javascript... hopefully Python + browser is not so very far away. I know the PyPy guys had been experimenting with sandboxing python and plugging it into webkit.

If you want to go with Swing, but avoid programming Java, you can use Jython + Swing. It's not a hard dependency to ship, and Jython works seamlessly with Java classes.

Remember: By coding in Python instead of Java, you can save enough coding time to spend extra time at the end of your project figuring out how to deploy it seamlessly on different platforms.

Dusty

Offline

#4 2009-10-19 05:03:13

archlinuxsagi
Member
Registered: 2008-09-12
Posts: 259

Re: Is Java the only real way of doing cross-platform GUI

QT and GTK

Offline

#5 2009-10-19 05:17:13

blakeman8192
Member
From: Earth
Registered: 2009-09-19
Posts: 7

Re: Is Java the only real way of doing cross-platform GUI

In my opinion, Swing is pretty easy to program with, and very flexible (naturally, due to its highly object oriented nature).
I'd recommend going with Java, but my opinion is biased since I myself have quite a bit of experience programming with Java.

Offline

#6 2009-10-19 14:57:25

dalingrin
Member
Registered: 2009-03-18
Posts: 128

Re: Is Java the only real way of doing cross-platform GUI

I think Qt is currently the best cross platform gui toolkit. Especially if you care about speed and effortless native look.

Offline

#7 2009-10-19 16:27:05

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Re: Is Java the only real way of doing cross-platform GUI

Thanks for your input. Just to clarify a few things: Though I said JVM + Swing, I don't mean that I'll actually be programming in Java. I plan on using Jython or Scala (if I think I have the time to learn it). Java isn't a bad language, but there are things that I've gotten used to in other languages that I would like to have. I'll look a bit more into distributing wxPython on Mac and Windows and see if simple enough.
Please keep the suggestions coming


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#8 2009-10-19 16:33:55

Zeist
Arch Linux f@h Team Member
Registered: 2008-07-04
Posts: 532

Re: Is Java the only real way of doing cross-platform GUI

dalingrin wrote:

I think Qt is currently the best cross platform gui toolkit. Especially if you care about speed and effortless native look.

I am also of this opinion.


I haven't lost my mind; I have a tape back-up somewhere.
Twitter

Offline

#9 2009-10-19 20:53:33

jdhore
Member
From: NYC
Registered: 2007-08-01
Posts: 156

Re: Is Java the only real way of doing cross-platform GUI

I recommended GTK and Glib for cross-platform GUI coding. GTK is available on all 3 major platforms (and the BSD's, Solaris, etc) and Glib makes coding easy because if you use gint or gchar (for example) instead of int or char, Glib will automagically make all that stuff work with whatever platform its being compiled on.

Offline

#10 2009-10-20 00:10:47

sctincman
Member
From: CO (USA)
Registered: 2009-04-08
Posts: 85

Re: Is Java the only real way of doing cross-platform GUI

If you're going with Python, why not look into Tk? I think most python packages come with Tkinter compiled it, which would satisfy the cross platform requirement (I know bkchem uses it for this purpose). The only downside is I think Tk is kind of ugly :/

Last edited by sctincman (2009-10-20 00:17:56)

Offline

#11 2009-10-20 00:12:08

dalingrin
Member
Registered: 2009-03-18
Posts: 128

Re: Is Java the only real way of doing cross-platform GUI

FYI, there are multiple Python bindings for Qt. If you are not going to be programming in Java then I certainly would go with something else for the GUI toolkit. I mean, not many people would choose
Swing over another toolkit if they are not locked into Java.
Qt was specifically designed to provide extremely simple cross platform portability.

Offline

#12 2009-10-20 01:29:26

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: Is Java the only real way of doing cross-platform GUI

sctincman wrote:

If you're going with Python, why not look into Tk? I think most python packages come with Tkinter compiled it, which would satisfy the cross platform requirement (I know bkchem uses it for this purpose). The only downside is I think Tk is kind of ugly hmm

Yeah, I haven't heard of any ways to make Tk look like anything but Motif ran over by a giant steamroller.

I think Qt is probably overall the best.  Java has both SWT and Swing, which work pretty well, and GTK+ is fairly cross-platform, but Qt is the gold standard here.  wxWidgets was also recommended, that's worth a look, it's what Firefox uses.  It does Win32 and GTK+ styling very well.

Offline

#13 2009-10-20 02:47:26

Basu
Member
From: Cornell University
Registered: 2006-12-15
Posts: 296
Website

Re: Is Java the only real way of doing cross-platform GUI

I've used Python with PyQt a bit and I quite like, but it seems like a bit of pain to install it in Windows or OS X. Ideally I would like to be able to give users a single file (or a single directory) which they can just click and run without having to install a bunch of frameworks first. Hence the Jython/Scala with Swing idea since I could build a .jar and let it loose.


The Bytebaker -- Computer science is not a science and it's not about computers
Check out my open source software at Github

Offline

#14 2009-10-20 03:03:19

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: Is Java the only real way of doing cross-platform GUI

Basu wrote:

I've used Python with PyQt a bit and I quite like, but it seems like a bit of pain to install it in Windows or OS X. Ideally I would like to be able to give users a single file (or a single directory) which they can just click and run without having to install a bunch of frameworks first. Hence the Jython/Scala with Swing idea since I could build a .jar and let it loose.

It's called static linking, and it's the norm on Windoze wink  We GNU/Linux users just have this awesome package management system, so we can use 1337 dynamic linking.  Easy to get used to, ain't it?

Offline

#15 2009-10-20 14:12:42

Squall90
Member
From: Germany
Registered: 2008-10-19
Posts: 26

Re: Is Java the only real way of doing cross-platform GUI

Basu wrote:

I've used Python with PyQt a bit and I quite like, but it seems like a bit of pain to install it in Windows or OS X. Ideally I would like to be able to give users a single file (or a single directory) which they can just click and run without having to install a bunch of frameworks first. Hence the Jython/Scala with Swing idea since I could build a .jar and let it loose.

You could realize it with C++ and QT. But therefore you have to compile Qt and your program statically.
Btw: I don't know if you can compile your programs with other programming languages than C++ statically.

Last edited by Squall90 (2009-10-20 14:14:13)

Offline

#16 2009-10-20 15:28:51

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: Is Java the only real way of doing cross-platform GUI

Just about anything can be statically linked.  You can even statically link Python and Perl scripts with the interpreter and all the needed libraries, although that would of course hog lots and lots of space that probably isn't necessary.  Compiled languages like C and C++ are the best options for static linking imo.

I find it contradictory that you want "to give users a single file [that] they can just click and run without having to install a bunch of frameworks first", and immediately turn to Java.  Java is not universal, and it's a significantly large framework to have to install just to run one program.  I can write a GUI program with Python and Tkinter and tell Windows users to install Python first; it's the same thing as compiling a .jar and telling Windows users to install Java first.  If you really just want a click-and-run executable, then your only option (for Windows) is a statically linked .exe.

Offline

#17 2009-10-21 04:42:09

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: Is Java the only real way of doing cross-platform GUI

Trent wrote:

Just about anything can be statically linked.  You can even statically link Python and Perl scripts with the interpreter and all the needed libraries, although that would of course hog lots and lots of space that probably isn't necessary.  Compiled languages like C and C++ are the best options for static linking imo.

I find it contradictory that you want "to give users a single file [that] they can just click and run without having to install a bunch of frameworks first", and immediately turn to Java.  Java is not universal, and it's a significantly large framework to have to install just to run one program.  I can write a GUI program with Python and Tkinter and tell Windows users to install Python first; it's the same thing as compiling a .jar and telling Windows users to install Java first.  If you really just want a click-and-run executable, then your only option (for Windows) is a statically linked .exe.

Difference being that most probably the user already has java, since more and more webpages require it to run.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#18 2009-10-21 04:48:01

SamC
Member
From: Calgary
Registered: 2008-05-13
Posts: 611
Website

Re: Is Java the only real way of doing cross-platform GUI

Ngoonee: Really? I don't have Java installed on any of my machines. You never seem to run into it, especially with the increasing possibilities with Javascript.

Offline

#19 2009-10-21 05:43:02

the_isz
Member
Registered: 2009-04-14
Posts: 280

Re: Is Java the only real way of doing cross-platform GUI

Just wanted to add a tiny thing:

You can also link Qt dynamically and just ship the necessary binaries along with
the executable. Finding out the necessary binaries for windows is easy when
using dependency walker (www.dependencywalker.com).
For linux, you can just make Qt a dependency of the package with which you
distribute your program.

Offline

#20 2009-10-21 22:02:43

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Is Java the only real way of doing cross-platform GUI

Basu wrote:

I've used Python with PyQt a bit and I quite like, but it seems like a bit of pain to install it in Windows or OS X. Ideally I would like to be able to give users a single file (or a single directory) which they can just click and run without having to install a bunch of frameworks first. Hence the Jython/Scala with Swing idea since I could build a .jar and let it loose.

You could simply ship the qt libs your app needs  with your application? look at py2exe and similar.

Edit: I always try to stay the heck away from java apps. 99% of them don't play well along with my window managers.

Last edited by Mr.Elendig (2009-10-21 22:04:10)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#21 2009-10-24 02:58:08

deadlylife
Member
Registered: 2008-12-24
Posts: 120

Re: Is Java the only real way of doing cross-platform GUI

Adobe Air, but Arch support is hackish

Offline

#22 2009-10-24 03:44:02

Ranguvar
Member
Registered: 2008-08-12
Posts: 2,549

Re: Is Java the only real way of doing cross-platform GUI

Mr.Elendig wrote:

I always try to stay the heck away from java apps. 99% of them don't play well along with my window managers.

Would this help? smile  It doesn't matter whether or not you use Awesome or another WM.  The OpenJDK in the repos should already work fine, it's the normal JRE that is stupid.

[/offtopic]

Offline

#23 2009-10-24 03:52:29

some-guy94
Member
Registered: 2009-08-15
Posts: 360

Re: Is Java the only real way of doing cross-platform GUI

Ranguvar wrote:

wxWidgets was also recommended, that's worth a look, it's what Firefox uses.  It does Win32 and GTK+ styling very well.

Firefox uses XUL, also wxWidgets doesn't emulate styling like XUL, it uses another toolkit for actually doing stuff.

Offline

#24 2009-10-24 04:44:52

iBertus
Member
From: Greenville, NC
Registered: 2004-11-04
Posts: 2,228

Re: Is Java the only real way of doing cross-platform GUI

+1 for wxPython. I've used it along with matplotlib to develop a few graphical tools to analyze groundwater data that were required to run on Windows and Linux.

-1 to Java anything. I personally dislike all things Java.

Offline

#25 2009-10-24 11:07:15

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Is Java the only real way of doing cross-platform GUI

Ranguvar wrote:
Mr.Elendig wrote:

I always try to stay the heck away from java apps. 99% of them don't play well along with my window managers.

Would this help? smile  It doesn't matter whether or not you use Awesome or another WM.  The OpenJDK in the repos should already work fine, it's the normal JRE that is stupid.

[/offtopic]

I know all about changing the toolkit, lying about what wm you are using and so on. But they don't always work, and many hava apps takes badly to being forced into a size, either buttons and text gets hidden instead of resizing, or they just crash. smile

But enough about that.qt is good looking, somewhat easy to use (and write), and it's multi platform.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB