[kaffe] Portable Java GUI

Dalibor Topic robilad at kaffe.org
Mon Mar 1 11:22:02 PST 2004


Hallo Volker,

Volker Jahns wrote:
> Is there any recommendations out there, what to use other than Swing to
> code  a _real portable_ Java based GUI (using eg. Kaffe's jvm)? I am
> looking for a Java class, which doesn't use much space (no bloatware) and
> is distributed under some form of Open Source license.

That depends on how far you want 'portable' to stretch. AWT is part of 
all Java releases from Sun since JDK 1.0, but you don't want to use 1.0 
AWT unless you have to ;) Kaffe and Wonka, among free runtimes for java, 
have got pretty complete AWT support, gcj & other GNU Classpath based 
runtimes are catching up quite quickly. Given the recent progress gcj 
developers are making on Swing, I'd say that even a free swing 
implementation is possible within a reasonable time frame. but Swing is 
only available since JDK 1.2 (or JDK 1.1.7 + external swing.jar).

>>From my little experience (now that a first Java prototype using Swing
> components has been coded) it is rather a pain to get that GUI code
> running on platforms/jvms other than using Sun's newest J2SE, version
> 1.4.1 or 1.4.2. Thus, while the promised platform indepency of Java is
> claimed, practice seems to far off this goal.

Depending on how far you want portability to stretch, you can get very 
nice results using bindings to native code cross platform GUI libraries, 
like Qt, Gtk and SWT. Since those bindings usually just use JNI, they 
run fine on most free and non-free runtimes alike. Another way is to 
abstract the GUI away into an XML representation, and generate 
platform-specific code form that. XUL, Luxor, XWT go in that direction. 
I haven't played with either of them, so I can't say how well they work 
with free runtimes.

cheers,
dalibor topic




More information about the kaffe mailing list