*BSD News Article 85262


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!metro!metro!seagoon.newcastle.edu.au!brushtail.hna.com.au!dinsdale!matt
From: matt@dinsdale.hna.com.au (Matt McLeod)
Subject: Re: JDK for FreeBSD
Organization: Hunter Network Association, Australia
Message-ID: <E2nALz.tn@dinsdale.hna.com.au>
References: <32AD41AC.41C67EA6@telusplanet.net> <591p59$3ph@hamilton.maths.tcd.ie> <32B6152F.79AF@ica.net>
Date: Thu, 19 Dec 1996 05:15:35 GMT
Lines: 33
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:32807

In article <32B6152F.79AF@ica.net>, Lisa Ing  <lisa.ing@ica.net> wrote:
>David Malone wrote:
>> Does JDK manipulate X-Windows as it GUI?
>
>Java libraries are suppose to be independent of the 
>machine that you are running, but I cannot see how
>it can be if it must call Windows libraries on 
>MS-Dos machines and X-windows libraries on Unix 
>machines.
>Does Java have its own GUI then?

My understanding of this is a little hazy, but I'm sure I'll be corrected if
I make any mistakes...

Java applications (and applets) use AWT - which provides the interface to
the windowing system for the programmer.  To support a new platform, the AWT
runtime has to be ported (perhaps as part of the VM?).

But the programmer doesn't (or shouldn't) have to worry about this.  They
just use AWT (or one of the other toolkits available that sit on top of
AWT), and AWT deals with the rest.  In this way, a Java application using
AWT can present much the same UI (with some differences - AWT doesn't draw
the widgets or anything, it just uses the widgets provided by the windowing
system [or widget library], so the appearance will be different between
platforms) on X/Motif, Windows, Presentation Manager, Mac, or anything else
anyone chose to port the runtime to (e.g., someone might choose to do a
version that talks to GGI or svgalib on Linux, or use a different set of
widgets).

This is one of the things I like most about Java.  I'm never satisfied with
any platform (for personal use), so it's nice to be able to take my work
with me to pretty much any platform with little or no extra effort required.