You are not logged in.

#1 2008-02-13 14:22:04

lenni
Member
From: London, UK
Registered: 2007-09-21
Posts: 95

Java for GTK?

I'm quite good a programming in Python and PHP; I particularly like how easy it is to create Python scripts with a GTk GUI.

I had a look at Google's Android platform and I am quite interested developing for it. Apps, however, need to be written in Java. I've been thinking about learning Java or C++ anyway and I always (maybe foolishly) thought that C++ would go better with my current interest - programming GNOME/GTk apps - since most of GNOME apps are written in C or C++. I was always put off by the Java Swing approach, which makes applications look shit on all platforms (see Limewire).

I have googled around a found out that it is indeed possible to write Java apps that use native GTk and Glade.

My questions:

1. Is it at all possible and enjoyable to write Java apps for GNOME or does it feel like a square peg in a round hole? In other words, is it worth me learning Java for Android and then also use this knowledge for GNOME apps?

2. Is C++ a good language to learn or is it being overtaken by Java anyway?

Thanks
Lenni

Offline

#2 2008-02-13 14:36:22

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: Java for GTK?

First hit in google on "java gtk" will lead you to the java-gnome website.

I don't think C++ will get overtaken by Java, both have a different usage and different strong points.

Offline

#3 2008-02-13 15:03:04

lloeki
Member
From: France
Registered: 2007-02-20
Posts: 456
Website

Re: Java for GTK?

if C++ ever gets taken over, it's by D, not Java.

That said, you may want to take a look at SWT. It will make your app use the toolkit native on the system you use it.

Last edited by lloeki (2008-02-13 15:05:21)


To know recursion, you must first know recursion.

Offline

#4 2008-02-15 07:03:12

Mr. Ego
Member
Registered: 2007-12-04
Posts: 20

Re: Java for GTK?

In my opinion SWT has also cleaner API. There is one drawback that some of widget classes are impossible to subclass, but I think those you may will want to subclass will be subclassable.

SWT has also richer widget base, and very good documentation with code snippets that are very useful and speed up understanding SWT.

Offline

#5 2008-02-15 10:27:09

sweiss
Member
Registered: 2004-02-16
Posts: 635

Re: Java for GTK?

If you're already proficient with PHP and Python, perhaps it's better to go with Java which is yet another managed language.

C++ is unmanaged and thus includes many problems related to memory management, which are most of the time nothing but a pain in the butt.

C++\C is what you should be using for realtime, or very performance critical usages. For most applications that is not the case, and memory management becomes nothing but a useless overhead.

Offline

#6 2008-02-15 12:52:02

lenni
Member
From: London, UK
Registered: 2007-09-21
Posts: 95

Re: Java for GTK?

Thanks for your replies.

I had a look around and browsed through Java in a Nutshell in the library and I think I'll go for Java. Particularly because that's what I'm gonna be using when I start my ComSci course in the summer.

Offline

#7 2008-02-17 01:54:32

timtux
Member
From: Gävle, Sweden
Registered: 2005-10-04
Posts: 178
Website

Re: Java for GTK?

Java is a really nice language, I love it!

http://timtux.net/16-jipox-the-proxy-leecher cross platform with native look. GTK on Gnome, Windows Look on Windows wink
I do however NetBeans with the Swing designer. Manually editing complex GUI's SUCK.

Another good thing about java is that it's so well documented, and it's really easy to find tutorials for special tasks :-)


http://timtux.net/ - my personal blog about almost everything

Offline

#8 2008-02-17 02:15:39

venox
Member
From: Curitiba, Brazil
Registered: 2003-08-23
Posts: 137
Website

Re: Java for GTK?

I like Java too. The only thing I don't like about it is Swing. It's slow and buggy on most of tiling WMs.

Offline

#9 2008-02-18 11:45:59

lenni
Member
From: London, UK
Registered: 2007-09-21
Posts: 95

Re: Java for GTK?

I've got on more question though. Why is the JRE so huge compared to interpreters like Python and PHP?

Offline

#10 2008-02-19 13:10:00

Sekre
Member
From: The Rainy North
Registered: 2006-11-24
Posts: 116

Re: Java for GTK?

lenni wrote:

I've got on more question though. Why is the JRE so huge compared to interpreters like Python and PHP?

yeah, been wondering this aswell.
I'm studying java and python in a sort o mix, and the difference in size is quite big :S

Java Guru shed your Wisdom upon us mortals !

Offline

#11 2008-02-19 14:44:45

lloeki
Member
From: France
Registered: 2007-02-20
Posts: 456
Website

Re: Java for GTK?

Try this:

$ du --max-depth 0 -h /opt/java
103M    /opt/java
$ du --max-depth 0 -h /usr/lib/python2.5
91M    /usr/lib/python2.5

Also note that java has many 'packages' (be they crap or not, I'm not discussing this) built-in that python has via extra packages, so I do count the few python packages I have installed in site-packages (like pygtk) as part of python for the comparison to be somehow fair.

The strategy Sun applied in Java is that the JRE should be kitchen-sink enough so that most apps can be built using only the Java classes, so that one only needs the JRE and no funky dependency to deploy and run many applications. Thus the JRE is indeed a huge beast, a thing that some consider to be bloat, and this is debatable to no ends. I'd say java is monolithic (though extendable) in its approach, while python is much more modular.

PHP is an entirely different beast altogether, and seems to have grown out of an accumulation of any thing people needed, were used to, felt convenient, or made some sense to them at one point. this just led to an inordinate amount of entropy being generated, with a fair share of one's brain resources dedicated at any time to try and put some order in that stuff when one has to continuously make up for blatantly wrong design choices (or non-choices). The fact that the thing still holds together consistently baffles me to this day. And the fact that I am, to this day, forced to develop in PHP4 (despite arguing, among other points, that it is soon out-of service (13-Jul-2007)) is one of the motives to my bitterness.

Last edited by lloeki (2008-02-19 15:17:18)


To know recursion, you must first know recursion.

Offline

Board footer

Powered by FluxBB