Java IoT Authors: Liz McMillan, Elizabeth White, Yeshim Deniz, Pat Romanski, Zakia Bouachraoui

Related Topics: Java IoT

Java IoT: Article

'Swing Is Swinging Java out of the Desktop'

'Swing Is Swinging Java out of the Desktop'

Over the past few months, I've frequently stated my belief that Java, in its present state, doesn't stand much chance on the desktop against the march of Microsoft's WinForm technology from the .NET Framework. A view, I've discovered, shared by many of you. Before I continue, let me clarify my position so we're all on the same page.

The only frameworks currently available to the Java developer from the standard JDK are, of course, AWT and Swing. Naturally, we're not talking about other client-side technologies, such as SWT and thinlets, to name a few; but more on them later.

The less said about AWT the better. It doesn't even stand up to the functionality of an HTML page with a basic FORM embedded in it. But we were told not to despair; Sun promised that a much better technology was in the works. We were then presented with Swing, which definitely looked the part. However, while academically a sound design, in reality, it's a dog-slow technology that suffers from far too much abstraction and object creation to be practical. Swing applications require a lot of memory and a lot of horsepower to get anywhere. I know there are some great examples of Swing applications but, 9 times out of 10, I'm shown Forte and other heavyweight IDEs, which conversely are great examples of how much stress Swing really does put on the desktop.

On many Java forums around the planet are some great analysis pieces on why Swing is slow and impractical. I urge you to check out some of the discussions on Javalobby and Slashdot; you'll notice the conspicous absence of any counterarguments.

I've already mentioned in previous editorials how we've missed the boat with applets and how Macromedia has stolen Java's thunder with its Flash technology. It grates on my nerves every time I surf to a particularly Flash-heavy site, as this was the precise role Java had promised to fulfill. I strongly believe that AWT lost us this battle, and Swing was far too heavy to be anywhere near a browser to even be considered in the running.

The title of this editorial (sadly not mine but from a poster to our "Ask JDJ" feature, www.n-ary.com/java/jdj/askjdj_question.cfm?JDJ_ID=4) sums it up very well: if Swing is our only hope, boy are we in trouble!

However, don't despair. I have news...great news...about Java on the client side. We may have lost the first round, but the war is still being fought. Since we can't rely on Sun to offer help here (I'm still waiting for a return e-mail from Sun's tech lead for client-side Java, who still has to defend Sun's Swing position), we have to turn to the efforts of third parties ­ you won't be disappointed.

The first technology I'd love to tell you about is thinlets (www.thinlet.com) ­ an effort from an individual buried deep in Europe. This is a lightweight GUI framework with rich widgets that you can easily use. You describe the front end using XML, and it's quick and easy to build up an applet. The framework is 30KB. That's it! Check out the Amazon demo and please e-mail me if you aren't impressed. This is why Java is so exciting and shouldn't be underestimated.

The second technology is the Standard Widget Toolkit (SWT) from the Eclipse project (www.eclipse.org). This is a little heavier than the thinlet technology and builds applications that would ordinarily be installed on the desktop. It's a direct competitor to Swing and, from all reports, does a much better job. By all accounts, running an Eclipse IDE on a 400MHz machine is very fast, in stark contrast to running an equivalent Swing application within the same constraints.

If you need your faith in Java reenergized, look to the community and what they're doing. If you're waiting for Sun, don't. They're too busy fighting Microsoft to worry about the actual technology they're supposedly fighting for!

More Stories By Alan Williamson

Alan Williamson is widely recognized as an early expert on Cloud Computing, he is Co-Founder of aw2.0 Ltd, a software company specializing in deploying software solutions within Cloud networks. Alan is a Sun Java Champion and creator of OpenBlueDragon (an open source Java CFML runtime engine). With many books, articles and speaking engagements under his belt, Alan likes to talk passionately about what can be done TODAY and not get caught up in the marketing hype of TOMORROW. Follow his blog, http://alan.blog-city.com/ or e-mail him at cloud(at)alanwilliamson.org.

Comments (17) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

Most Recent Comments
vincentm 02/06/03 10:58:00 PM EST

I've used both SWT and swing. It is clear that SWT based guis are more memory efficient and more responsive. Writing your own SWT widgets is not yet an option because you would have to natively implement it on numerous platforms. But then again I never had a need for a new widget. Usually I buy my widgets as opposed to writing them from scratch. We do need more vendor support for SWT. Where are the gui builder and widget vendors? IBM is not really pushing this technology hard enough. Also I would like to see it incorporated into the JDK.

Jeff Benjamin 11/15/02 01:49:00 PM EST

I've done VB, Win16/32 straight C, MFC, ATL, WTL, and AWT. Swing is by far the easiest to learn and use, and the most comprehensive and seamless GUI kit of all of them. The MVC theme goes to the core of the API and the result is drastically decreased development time. I just finished porting an MFC app that took 2 years to produce to Swing in 3 months. It is shipping in place of the production product because we had all the features plus more, and it is totally bug-free and stable. Swing rocks! And my reward is that I now work 3 days a week instead of 6 and we've cut the support staff in half! Let's see you beat that with .Not!

Roderick L. Barnes 10/24/02 07:21:00 PM EDT

I appreciate what you are trying to do by raising the consciousness of people who would rather ignore the advance of .NET. However, it does seem that you've become a spokesperson for fear and a advocate of reactionism. Moreover, you're bringing forward solutions that really are either nascent, inchoate or provincial.

Alan, you can do better - you have done better in the past. We need better.


ben lim 10/24/02 11:39:00 AM EDT

I wrote Windows applications using MFC for seven years. Now I write Swing apps and will never go back writing for Windows. Swing is very elegant and so much easier to use than MFC. There is also the cross platform portability you don't get with Windows.

Michael Bushe 10/22/02 09:08:00 PM EDT

I'm fed up with JDJ and Editor Alan Williamson fixating on .Net, it's a flippin' JAVA mag goshdarnit! Every month it's .Net this, .Net that. They've lost sight of Java's dominance and power. Alan's so caught up in .Net he has no business being JDJ editor anymore, he should put his job where his fear is and move to .Net Journal.

Notice how this all came about after M$ invited Alan for a weekend in Redmond to talk about .Net? Since then EVERY month it's "The Java sky is falling!" Musta been some set of slides. I wonder what they put in his pizza. Meanwhile, I'm still looking for a .Net deployment.

Java is an ENOURMOUS industry with a huge base of companies, apps, tools, developers, servers, phones, and lots of other whatnot involved. Think about all the APIs in Java, then think about the hundreds of JSRs that will grow it further. M$ has a LONG way to go to even get close. They've got lots of money to throw at it, but it's going to take a LONG time and won't displace Java.

JDJ is one fat advertisement anyway, I'm letting my subscription die and spending more time with the more development-oriented and Java-oriented mags.

Michael Bushe

Rob Williams 10/22/02 01:50:00 AM EDT

How did this knuckle-dragger ascend the pulpit and how in the hell has he held it for so long??!! Lab rats are capable of logic that the esteemed author seems unable to muster. His claim that 'der, I know there are a lot of good Java apps but most of them suck so the framework stinks....' Please, can we hold a straw poll and get rid of this clown? The byline should read Charles L. Head.

Ted Stockwell 10/19/02 10:45:00 AM EDT

SWT is no different in concept than AWT. The only diffence between SWT and AWT is that the binding to native components can be written in Java instead of C/C++. Big deal.

Want to write a new kind of widget in SWT? Be prepared to recreate the widget for every platform you want your application to run on. That's not very cross-platform in my book. With Swing I can create a new widget and be assured that it will work everywhere that Swing works. Nice.

Want the same behavior with regard to focus handling across all platforms? Forget about it. SWT can't guarantee cross-platform behavior so be prepared to modify your code for each OS. My Swings apps are guaranteed to behave the same everywhere.

Yep, Swing is nicely cross-platform and Swing UIs beat the hell out of web applications.

ted stockwell

Tina 10/12/02 01:17:00 AM EDT

I see more and more swing apps these days from vendors. The main reason is that cross platform is so easy in Java and its proven not like .Not hype. Since Linux is the OS for future everyone is using swing these . The reality is Windows days are numbered they will be super passed by Linux very easily we all know that. In the corporate world more apps are ran in Linux than windoze and after RHAT 8.0 and other linux distro Desktops in Linux are not far behind ( Wlamart and lindows ). So in the long rung Java swing will win the desktop I have real doubts about .Not future.

Sarwar Mansoor 10/08/02 08:35:00 PM EDT

I think swing has improved a lot with each JDK release please look at IDEA IDE from IntelleJ and also Weblogic Workshop. I have also used ThinkFree office which is great swing application.

Royce 10/04/02 08:54:00 PM EDT

Well your kind of correct but I think you are being to general. I have been writing Swing for a couple of years now and it does have it's quirks and yes it isn't as fast as a compiled Windows app. But running on any semi modern machine with let's say a 1Ghz or faster processor (which is old now) it is plenty fast. Running on a new machine that's over 2 Ghz in speed its downright snappy. In fact you would be hard pressed to tell the difference in most real world applications.

Then there is the examples... well you can look at Netbeans, Forte, ThinkFree Office, MagicDraw UML, HummingBird Exceed Lite, Oracle's Admin suite....to just name a few that are excellent examples of what can be done with Swing.

And Swing does deliver on portability. It is easy to write an app that will work just as well on a Sun box, PC, and a Mac with very little effort to make them compatible. Try that with any other language or tool set. I don't think you can with anything else. At least without doing a lot of extra work to get them to compile etc..

Swing may not be perfect but it's not that bad and if you are willing to learn what it can do it can be down right great for most tasks.

Roger Irwin 10/04/02 03:53:00 AM EDT

When I first read about JAVA all those years ago, I had an idea in my head that was something like 'thinclient'.

Of course what we actually got was AWT with the bouncing heads.

Over the years we keep hearing about saviours to the Java UI effort (Swing, beans etc), and every time I think finally there will be somethink like thinclient.

Well, now there is!

I have heard about SWT. So where are the apps? When will we go to TUCOWS and click on a package that installs itself and runs **AND WE DO NOT KNOW IT IS IN JAVA**.

David Orme 10/03/02 10:02:00 PM EDT

While it may be possible for Swing gurus who write Java bytecodes in their sleep to create Swing-based programs that are both reasonably fast and have an "almost native" look and feel, SWT gives you all of this for *free*.

Create a tree control on Windows--it's a real Windows tree control. It looks, feels, and *performs* just like a real Windows tree control because it *is* a real Windows tree control.

Move this same application to Linux, and the same tree control automatically appears as a GTK 2.0 tree control, complete with automatic support for GTK 2.0 themes. Because on Linux it *is* a GTK 2.0 tree control.

Same for MacOS X.

And I can't emphasize this enough--all this support comes for *free* to the SWT app programmer.

Although others will argue that it is perfectly possible for talented Swing gurus to create Swing applications with good performance and a native look/feel (and I wouldn't dispute this), they miss the point. At issue is not what a highly experienced Swing architect can accomplish but what your average C# programmer can do.

In this battle, SWT is the clear winner.

Chad 11/06/02 03:43:00 PM EST

SWT provides exactly what you want for platform L&F. It is the platform look and feel. Of course it is not consistent across platforms, once again it is the platforms look and feel. Swing at best gives you the look, but not the feel. The behaviour of applications with SWT reflects what people expect on the platform it is running.
Also, SWT is not more difficult to maintain than Swing. Swing must be updated to reflect every look and feel change for every OS which changes its look and feel. This is very difficult. Once the SWT base is provided. Nothing needs to be updated if the OS changes its look, no Java or native code needs to be modified. The argument the SWT is more maintainance is not necessarily true. It is a lot of work for the first implementation. After that, should be simpler to maintain.

Pradipto Bhattacharya 10/31/02 12:58:00 AM EST

Hey JDJ Editor,
I think u r in confusion that swing is going out of desktop.The truth is, many companies like Veritas,AccelTree etc. are changing there product's GUI to Swing GUI.
I myself worked on AccelTree FULCRUM Enterprise Edition 1.1.The product was previously made in VB but now it is partly made in Java and VB.in future we r going to convert the whole product in Java and Swing.
Please show my reply in hot topics so that all java developers around the world will get a boost.

Jim Ruggles 10/30/02 09:45:00 AM EST

We have convert several apps to swing almost 2 years ago. These apps were VB/PB apps that crashed on the client pcs left and right and we had spent a lot of resource and money to keep them up. After the apps were rewritten to swing our down time has decrease to almost to nothing and we didnt had to change codes as win98 , win200, and XP came in place . But the biggest joy now is we are putting Redhat 8.0 as our desktop these swing apps just run fine on them . So we have to thanks java and swing on saving us ton of money. We have adopted java as standard now.

Andy 10/27/02 07:57:00 AM EST

IMHO Swing is terrible. After years of listening to people say, 'It'll be much better/faster in the next release of the JDK', it isn't. It's a memory hog. It's slow. Developing swing apps is torture when compared to other tools like MFC/VB (Don't have a go at me about these tools. I agree. I'm making a point about how bad Swing is).

We have all seen good examples of Swing apps. But they are only one or two of them. Other technologies all seem to have a lot of good examples. If Swing was any good, we would all know how to write good apps because we could read books/articles to learn how to do it. The rarity of good examples just shows how bad Swing is.

I have worked on many projects over 6 years and I have never worked for a company that wanted a cross platform client GUI. They don't care if it's swing, mfc, or anything. They just want it to look good, and be delivered quickly. By these standards, Swing fails. Cross platform is good for server side work. But it is irrelevant for 99% of client side work.

Carl 10/26/02 07:27:00 PM EDT

Swing is great, it is easier than MFC.
Speed is not an issue with 1.4.x

Since so many people have been developing web applications, they forgot client side development. Winforms is like AWT on steroids or VB.
Swing can do things MFC can do and more with less code. There are many Swing books read them!!!

I won't blow your cover..
You do put fear in Java Developers Community a lot though.

There is one thing Bill can't buy and that's my soul.


IoT & Smart Cities Stories
SYS-CON Events announced today that CrowdReviews.com has been named “Media Sponsor” of SYS-CON's 22nd International Cloud Expo, which will take place on June 5–7, 2018, at the Javits Center in New York City, NY. CrowdReviews.com is a transparent online platform for determining which products and services are the best based on the opinion of the crowd. The crowd consists of Internet users that have experienced products and services first-hand and have an interest in letting other potential buye...
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
We are seeing a major migration of enterprises applications to the cloud. As cloud and business use of real time applications accelerate, legacy networks are no longer able to architecturally support cloud adoption and deliver the performance and security required by highly distributed enterprises. These outdated solutions have become more costly and complicated to implement, install, manage, and maintain.SD-WAN offers unlimited capabilities for accessing the benefits of the cloud and Internet. ...
"IBM is really all in on blockchain. We take a look at sort of the history of blockchain ledger technologies. It started out with bitcoin, Ethereum, and IBM evaluated these particular blockchain technologies and found they were anonymous and permissionless and that many companies were looking for permissioned blockchain," stated René Bostic, Technical VP of the IBM Cloud Unit in North America, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Conventi...
René Bostic is the Technical VP of the IBM Cloud Unit in North America. Enjoying her career with IBM during the modern millennial technological era, she is an expert in cloud computing, DevOps and emerging cloud technologies such as Blockchain. Her strengths and core competencies include a proven record of accomplishments in consensus building at all levels to assess, plan, and implement enterprise and cloud computing solutions. René is a member of the Society of Women Engineers (SWE) and a m...
DXWordEXPO New York 2018, colocated with CloudEXPO New York 2018 will be held November 11-13, 2018, in New York City and will bring together Cloud Computing, FinTech and Blockchain, Digital Transformation, Big Data, Internet of Things, DevOps, AI, Machine Learning and WebRTC to one location.
In an era of historic innovation fueled by unprecedented access to data and technology, the low cost and risk of entering new markets has leveled the playing field for business. Today, any ambitious innovator can easily introduce a new application or product that can reinvent business models and transform the client experience. In their Day 2 Keynote at 19th Cloud Expo, Mercer Rowe, IBM Vice President of Strategic Alliances, and Raejeanne Skillern, Intel Vice President of Data Center Group and G...
DXWorldEXPO LLC announced today that All in Mobile, a mobile app development company from Poland, will exhibit at the 22nd International CloudEXPO | DXWorldEXPO. All In Mobile is a mobile app development company from Poland. Since 2014, they maintain passion for developing mobile applications for enterprises and startups worldwide.
Founded in 2000, Chetu Inc. is a global provider of customized software development solutions and IT staff augmentation services for software technology providers. By providing clients with unparalleled niche technology expertise and industry experience, Chetu has become the premiere long-term, back-end software development partner for start-ups, SMBs, and Fortune 500 companies. Chetu is headquartered in Plantation, Florida, with thirteen offices throughout the U.S. and abroad.
DXWorldEXPO | CloudEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.