wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes Threat to AWT/SWING Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Threat to AWT/SWING" Watch "Threat to AWT/SWING" New topic
Author

Threat to AWT/SWING

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Sun does not like eclipse because it is a threat to AWT/SWING? Is it true.


Groovy
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
A funny thing but one of the problems that caused the falling out between MS and Sun was that MS was writing classes to interact directly with Windows objects. Sun made a big stink because programs written using those classes wouldn't be "run anywhere".


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Thomas,

Care to provide further explaination of your comment?

It seems a bit... ummm... non-sequitur.


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Sun saw what MS was doing as a direct threat to Swing which was new technology at the time. That is exactly what SWT is. It is a direct threat to Swing that will not run in every JVM.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

I thought the beef Sun had with MS is that they were providing "platform specific functionality" (i.e. bindings to COM and other MS specific stuff.) inside the core classes (java.lang.*). I don't even think Swing was out yet! (Wasn't the last MS JVM 1.1.8?) If all that MS was doing was making a platform specific binding of the GUI layer they could have easily accomplished this through Swing mechanisms, and Sun wouldn't have had a problem with that. In fact, that's exactly what Apple does with its OS X look and feel... and Sun doesn't berate them for it.

As for SWT, yes, it is a direct threat to Swing. But as for not running in every JVM, I don't see how you come to that conclusion. It does require platform specific shared libraries to run, but the java classes produced *will* run in any JVM. This isn't any different than AWT... AWT requires a shared library (provided with the JRE) to be on the system to actually produce any GUIs.

I suppose the argument may be that SWT isn't "write once, run anywhere", it's "write once, run anywhere that has an SWT shared library written for it." But this same statement is true for AWT. Also, you can check here to see all the platforms SWT runs on... it's pretty close to the same platforms you can run AWT/Swing on anyway.

As for why Sun doesn't like SWT... I don't know if this is true, but here's some lumber to throw on the rumor mill.

I've used Swing for quite a while and have been playing around with SWT recently, and each has it's advantages and disadvantages, but this isn't one.
Ed Burnette
Author
Ranch Hand

Joined: Jun 10, 2003
Posts: 142
Although the "lumber" thread mentioned above is pretty entertaining it has been partly (mostly?) debunked in numerous online discussions, see google.
SWT is a simple, high performance widget set. Swing is a higher level model-view GUI library. JFace provides some Swing-like features on top of SWT but they're not especially comparable.
Everything has its place. Here are some rules of thumb I suggest for people looking at user interfaces:
1. If your primary concern is competing with native desktop applications such as Windows apps written using C++/MFC or C# then you should take a good hard look at SWT (and JFace).
2. If your primary concern is writing a program that runs the same way on Unix, Mac, PC, etc. then Swing is a good choice.
3. If you're trying to target confined platforms with old versions of Java then AWT might be a good choice.
There are exceptions but that should give you a starting point.


Ed Burnette, Author of Hello Android
Blog: ZDNet's Dev Connection - Twitter: @eburnette
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Originally posted by Nathan Pruett:
I thought the beef Sun had with MS is that they were providing "platform specific functionality" (i.e. bindings to COM and other MS specific stuff.) inside the core classes (java.lang.*).

MS had their own set of packages labeled as com.ms.x. Sun even forced them to change their IDE so that if you selected the toolbar with those widgets you got a warning message that your code wouldn't be transportable.
The difference with SWT is that SWT works on a lot of OSes but that is because IBM has provided a lot of ports. If they had only provided a port to Windows would Sun be suing them? I doubt it.
Swing was out at that time but it was available only as a separate download.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
I don't know how "debunked" that post was but I think this is 100% truth:
"In retrospect, I think the "Microsoft Java Extensions" were a good idea: you could write pretty UI's in Java. Instead of admitting that there was a real need for this, Sun went to court and never offered something competitive."
That has been my complaint since 1997. AWT stinks. Swing is slow and buggy and way too complicated. If Sun hadn't been in their "we hate Microsoft" mode in 1997, C# and .NET would never have been written and former VB programmers would be using VisualStudio.Java to do their development.
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
Here is an interesting debate about swt/swing.
http://www.logemann.info/day/archives/000008.html
I've read a lot of anti-swing ranting, but it isn't that bad. Am using it in a project for frontenting with JAplet a Domino6 database (supports Java1.3). Don't even need to use slow Corba-implementation of Domino. It communicates with the Domino6 server through a lotus package which uses JNI wrappers for Lotus-RPC stuff.
So far I am positively surprised with performance and speed of development (I have done more webstuff before). With good books, Netbeans and some discussion partners in newsgroups, swing looks like a good choice for a lot of smaller/mid-range projects.
Would be great if I only get working that multi-Threading stuff with invokeAndWait() or/and invokeLater() to communicate with my NotesConnection class in its own thread this night or the next, to make the NotesConnection class statefull and gui-snapiness more scalable.
Wise what the guy says in his weblog:

But people forget that a "fast" application is not only widget-responsiveness, in real life, applications suck at database calls and business logic, there SWTs speed wont help you in any way.

regards Axel
[ July 15, 2003: Message edited by: Axel Janssen ]
Dan Kehn
Dastardly Dan the Author
Ranch Hand

Joined: Jun 11, 2003
Posts: 120
Originally posted by Ed Burnette:
Everything has its place. Here are some rules of thumb I suggest for people looking at user interfaces:
1. If your primary concern is competing with native desktop applications such as Windows apps written using C++/MFC or C# then you should take a good hard look at SWT (and JFace).
2. If your primary concern is writing a program that runs the same way on Unix, Mac, PC, etc. then Swing is a good choice.
3. If you're trying to target confined platforms with old versions of Java then AWT might be a good choice.

Good rules of thumb.
metacomment: It is worth mentioning for historical perspective that SWT wasn't a new idea at OTI. The UI of VisualAge for Smalltalk was based on a precursor implementation of SWT called CommonWidgets. Their approaches to widget portability are similar, however SWT is simplified in many respects, owing to the experience OTI gained over the years. The arguments about the superiority of these approaches ("heavyweight" versus "lightweight" widgets) are very familiar to Smalltalk programmers -- it was covered ad nauseum in comparisons of ParcPlace's Smalltalk (lightweight) and IBM/OTI's (heavyweight). In competitive situations, customers generally preferred the more "native looking" UI.
As a former Smalltalk programmer, it is interesting (and in some ways sad) that we're still debating this point over 10 years later.
-- Dan


Co-author of <a href="http://www.jdg2e.com" target="_blank" rel="nofollow">The Java Developer's Guide to Eclipse</a>, 2nd Edition<br />(Yahoo group <a href="http://groups.yahoo.com/group/JDG2E/" target="_blank" rel="nofollow">JDG2E</a>)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Threat to AWT/SWING