Java IoT Authors: Liz McMillan, Pat Romanski, Automic Blog, Elizabeth White, Roger Strukhoff

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.


@ThingsExpo Stories
In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, led attendees through the exciting evolution of the cloud. He looked at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering m...
"Digital transformation - what we knew about it in the past has been redefined. Automation is going to play such a huge role in that because the culture, the technology, and the business operations are being shifted now," stated Brian Boeggeman, VP of Alliances & Partnerships at Ayehu, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Nordstrom is transforming the way that they do business and the cloud is the key to enabling speed and hyper personalized customer experiences. In his session at 21st Cloud Expo, Ken Schow, VP of Engineering at Nordstrom, discussed some of the key learnings and common pitfalls of large enterprises moving to the cloud. This includes strategies around choosing a cloud provider(s), architecture, and lessons learned. In addition, he covered some of the best practices for structured team migration an...
No hype cycles or predictions of a gazillion things here. IoT is here. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, an Associate Partner of Analytics, IoT & Cybersecurity at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He also discussed the evaluation of communication standards and IoT messaging protocols, data...
Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, discussed how they built...
SYS-CON Events announced today that Evatronix 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. Evatronix SA offers comprehensive solutions in the design and implementation of electronic systems, in CAD / CAM deployment, and also is a designer and manufacturer of advanced 3D scanners for professional applications.
To get the most out of their data, successful companies are not focusing on queries and data lakes, they are actively integrating analytics into their operations with a data-first application development approach. Real-time adjustments to improve revenues, reduce costs, or mitigate risk rely on applications that minimize latency on a variety of data sources. In his session at @BigDataExpo, Jack Norris, Senior Vice President, Data and Applications at MapR Technologies, reviewed best practices to ...
SYS-CON Events announced today that Synametrics Technologies will exhibit at SYS-CON's 22nd International Cloud Expo®, which will take place on June 5-7, 2018, at the Javits Center in New York, NY. Synametrics Technologies is a privately held company based in Plainsboro, New Jersey that has been providing solutions for the developer community since 1997. Based on the success of its initial product offerings such as WinSQL, Xeams, SynaMan and Syncrify, Synametrics continues to create and hone inn...
"Evatronix provides design services to companies that need to integrate the IoT technology in their products but they don't necessarily have the expertise, knowledge and design team to do so," explained Adam Morawiec, VP of Business Development at Evatronix, in this SYS-CON.tv interview at @ThingsExpo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
With tough new regulations coming to Europe on data privacy in May 2018, Calligo will explain why in reality the effect is global and transforms how you consider critical data. EU GDPR fundamentally rewrites the rules for cloud, Big Data and IoT. In his session at 21st Cloud Expo, Adam Ryan, Vice President and General Manager EMEA at Calligo, examined the regulations and provided insight on how it affects technology, challenges the established rules and will usher in new levels of diligence arou...
Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
In his session at 21st Cloud Expo, Raju Shreewastava, founder of Big Data Trunk, provided a fun and simple way to introduce Machine Leaning to anyone and everyone. He solved a machine learning problem and demonstrated an easy way to be able to do machine learning without even coding. Raju Shreewastava is the founder of Big Data Trunk (www.BigDataTrunk.com), a Big Data Training and consulting firm with offices in the United States. He previously led the data warehouse/business intelligence and B...
The 22nd International Cloud Expo | 1st DXWorld Expo has announced that its Call for Papers is open. Cloud Expo | DXWorld Expo, to be held June 5-7, 2018, at the Javits Center in New York, NY, brings together Cloud Computing, Digital Transformation, Big Data, Internet of Things, DevOps, Machine Learning and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding busin...
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud ...
DevOps at Cloud Expo – being held June 5-7, 2018, at the Javits Center in New York, NY – 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 results. Among the proven benefits,...
@DevOpsSummit at Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, is co-located with 22nd Cloud Expo | 1st DXWorld Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to wait...
Cloud Expo | DXWorld Expo have announced the conference tracks for Cloud Expo 2018. Cloud Expo will be held June 5-7, 2018, at the Javits Center in New York City, and November 6-8, 2018, at the Santa Clara Convention Center, Santa Clara, CA. Digital Transformation (DX) is a major focus with the introduction of DX Expo within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive ov...
SYS-CON Events announced today that T-Mobile exhibited at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on qua...
SYS-CON Events announced today that Cedexis 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. Cedexis is the leader in data-driven enterprise global traffic management. Whether optimizing traffic through datacenters, clouds, CDNs, or any combination, Cedexis solutions drive quality and cost-effectiveness. For more information, please visit https://www.cedexis.com.