Welcome!

Java IoT Authors: Elizabeth White, Pat Romanski, Liz McMillan, Stackify Blog, Progress Blog

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.

Roderick

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.
Pradipto

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.

-Carl

@ThingsExpo Stories
SYS-CON Events announced today that N3N will exhibit at SYS-CON's @ThingsExpo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. N3N’s solutions increase the effectiveness of operations and control centers, increase the value of IoT investments, and facilitate real-time operational decision making. N3N enables operations teams with a four dimensional digital “big board” that consolidates real-time live video feeds alongside IoT sensor data a...
SYS-CON Events announced today that NetApp has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. NetApp is the data authority for hybrid cloud. NetApp provides a full range of hybrid cloud data services that simplify management of applications and data across cloud and on-premises environments to accelerate digital transformation. Together with their partners, NetApp em...
Real IoT production deployments running at scale are collecting sensor data from hundreds / thousands / millions of devices. The goal is to take business-critical actions on the real-time data and find insights from stored datasets. In his session at @ThingsExpo, John Walicki, Watson IoT Developer Advocate at IBM Cloud, will provide a fast-paced developer journey that follows the IoT sensor data from generation, to edge gateway, to edge analytics, to encryption, to the IBM Bluemix cloud, to Wa...
There is huge complexity in implementing a successful digital business that requires efficient on-premise and cloud back-end infrastructure, IT and Internet of Things (IoT) data, analytics, Machine Learning, Artificial Intelligence (AI) and Digital Applications. In the data center alone, there are physical and virtual infrastructures, multiple operating systems, multiple applications and new and emerging business and technological paradigms such as cloud computing and XaaS. And then there are pe...
SYS-CON Events announced today that B2Cloud will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. B2Cloud specializes in IoT devices for preventive and predictive maintenance in any kind of equipment retrieving data like Energy consumption, working time, temperature, humidity, pressure, etc.
DevOps at Cloud Expo – being held October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA – announces that its Call for Papers is open. Born out of proven success in agile development, cloud computing, and process automation, DevOps is a macro trend you cannot afford to miss. From showcase success stories from early adopters and web-scale businesses, DevOps is expanding to organizations of all sizes, including the world's largest enterprises – and delivering real r...
SYS-CON Events announced today that Massive Networks, that helps your business operate seamlessly with fast, reliable, and secure internet and network solutions, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. As a premier telecommunications provider, Massive Networks is headquartered out of Louisville, Colorado. With years of experience under their belt, their team of...
SYS-CON Events announced today that Suzuki Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Suzuki Inc. is a semiconductor-related business, including sales of consuming parts, parts repair, and maintenance for semiconductor manufacturing machines, etc. It is also a health care business providing experimental research for...
SYS-CON Events announced today that Fusic will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Fusic Co. provides mocks as virtual IoT devices. You can customize mocks, and get any amount of data at any time in your test. For more information, visit https://fusic.co.jp/english/.
SYS-CON Events announced today that Ryobi Systems will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ryobi Systems Co., Ltd., as an information service company, specialized in business support for local governments and medical industry. We are challenging to achive the precision farming with AI. For more information, visit http:...
SYS-CON Events announced today that Keisoku Research Consultant Co. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Keisoku Research Consultant, Co. offers research and consulting in a wide range of civil engineering-related fields from information construction to preservation of cultural properties. For more information, vi...
SYS-CON Events announced today that Daiya Industry will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Daiya Industry specializes in orthotic support systems and assistive devices with pneumatic artificial muscles in order to contribute to an extended healthy life expectancy. For more information, please visit https://www.daiyak...
SYS-CON Events announced today that Interface Corporation will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Interface Corporation is a company developing, manufacturing and marketing high quality and wide variety of industrial computers and interface modules such as PCIs and PCI express. For more information, visit http://www.i...
SYS-CON Events announced today that Mobile Create USA will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Mobile Create USA Inc. is an MVNO-based business model that uses portable communication devices and cellular-based infrastructure in the development, sales, operation and mobile communications systems incorporating GPS capabi...
In his session at @ThingsExpo, Greg Gorman is the Director, IoT Developer Ecosystem, Watson IoT, will provide a short tutorial on Node-RED, a Node.js-based programming tool for wiring together hardware devices, APIs and online services in new and interesting ways. It provides a browser-based editor that makes it easy to wire together flows using a wide range of nodes in the palette that can be deployed to its runtime in a single-click. There is a large library of contributed nodes that help so...
Elon Musk is among the notable industry figures who worries about the power of AI to destroy rather than help society. Mark Zuckerberg, on the other hand, embraces all that is going on. AI is most powerful when deployed across the vast networks being built for Internets of Things in the manufacturing, transportation and logistics, retail, healthcare, government and other sectors. Is AI transforming IoT for the good or the bad? Do we need to worry about its potential destructive power? Or will we...
SYS-CON Events announced today that mruby Forum will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. mruby is the lightweight implementation of the Ruby language. We introduce mruby and the mruby IoT framework that enhances development productivity. For more information, visit http://forum.mruby.org/.
SYS-CON Events announced today that Nihon Micron will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Nihon Micron Co., Ltd. strives for technological innovation to establish high-density, high-precision processing technology for providing printed circuit board and metal mount RFID tags used for communication devices. For more inf...
SYS-CON Events announced today that SIGMA Corporation will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. uLaser flow inspection device from the Japanese top share to Global Standard! Then, make the best use of data to flip to next page. For more information, visit http://www.sigma-k.co.jp/en/.
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.