🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #8911

Re: awt v swing : better portability?

#8911
From: John P. McGrath
Date: Mon, 26 Jun 2000 00:00
51 lines
2714 bytes
On Mon, 26 Jun 2000 00:06:41 +0100, Greg Lorriman wrote:

> I got the impression (correct me if I'm wrong) that many
> of java's cross JVM problems (write once- debug everywhere)
> were due to differences in services implementations. Counting
> AWT as a service then the fact that it requires hooking into
> the underlying OS's presentation capabilities it would seem
> that AWT would be much more prone to implementation deficiencies.
> and therefre cross-platform vulnerabilities, than swing.
> 
> Is this the case? Are my swing projects going to have fewer
> problems on other platforms?

Yes.  That has been my experience.

I would not expect to see "write once, run anywhere", at least not in the 
form that it was hyped originally.  I would still recommend testing an 
application on the various target platforms.  But chances are that you 
will not run into any significant problems when porting.

For example, not that long ago, I moved a 75,000 line Swing application 
to a Linux box for the first time.  I found one significant problem with 
some code that uses the drag-and-drop API, and everything else worked 
fine.

It is not completely perfect.  But I know of no language / GUI library 
that will port to other platforms with fewer problems.


> I've also heard that swing does actually use something of the
> AWT underneath itself. If that's the case then it would seem
> to undermine any possible portability advantage that swing
> might have. Have I picked up a butt end?

Swing does use AWT, but only the top-level components (i.e. Frame, 
Window, and Dialog).  It uses these components to provide a drawing 
surface that it uses to render the Swing components, and as a conduit for 
receiving events.

Most of the compatibility problems were related to the differences in 
behavior between the different platforms' implementations of higher level 
components, such as List, Menu and Button, which Swing does not use.

Sun has also had a chance to iron out many of the problems that are 
related to the top-level AWT components that Swing does use.  Java is far 
more mature than it was when "write once, debug everywhere" was coined.

-- 
John P. McGrath
<JPMcGrath@fast.net>
<jpm@nscs.fast.net>
Technical Details
Message-ID: <MPG.13c0b5f55c8c3b939899e6@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <39568e70@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,fbd6d6e715118066
X-Google-Attributes: gid111d45,public
From: John P. McGrath <JPMcGrath@fast.net>
Subject: Re: awt v swing : better portability?
Date: 2000/06/26
Message-ID: <MPG.13c0b5f55c8c3b939899e6@forums.borland.com>
X-Deja-AN: 638997259
References: <39568e70@dnews>
Organization: Another Netscape Collabra Server User
Newsgroups: borland.public.jbuilder.java.swing