Welcome!

Java IoT Authors: Liz McMillan, Xenia von Wedel, Elizabeth White, Yeshim Deniz, Tim Hinds

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
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
BnkToTheFuture.com is the largest online investment platform for investing in FinTech, Bitcoin and Blockchain companies. We believe the future of finance looks very different from the past and we aim to invest and provide trading opportunities for qualifying investors that want to build a portfolio in the sector in compliance with international financial regulations.
Imagine if you will, a retail floor so densely packed with sensors that they can pick up the movements of insects scurrying across a store aisle. Or a component of a piece of factory equipment so well-instrumented that its digital twin provides resolution down to the micrometer.
In his keynote at 18th Cloud Expo, Andrew Keys, Co-Founder of ConsenSys Enterprise, provided an overview of the evolution of the Internet and the Database and the future of their combination – the Blockchain. Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settle...
Product connectivity goes hand and hand these days with increased use of personal data. New IoT devices are becoming more personalized than ever before. In his session at 22nd Cloud Expo | DXWorld Expo, Nicolas Fierro, CEO of MIMIR Blockchain Solutions, will discuss how in order to protect your data and privacy, IoT applications need to embrace Blockchain technology for a new level of product security never before seen - or needed.
Leading companies, from the Global Fortune 500 to the smallest companies, are adopting hybrid cloud as the path to business advantage. Hybrid cloud depends on cloud services and on-premises infrastructure working in unison. Successful implementations require new levels of data mobility, enabled by an automated and seamless flow across on-premises and cloud resources. In his general session at 21st Cloud Expo, Greg Tevis, an IBM Storage Software Technical Strategist and Customer Solution Architec...
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...
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, discussed how from store operations and ...
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...
"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...
When shopping for a new data processing platform for IoT solutions, many development teams want to be able to test-drive options before making a choice. Yet when evaluating an IoT solution, it’s simply not feasible to do so at scale with physical devices. Building a sensor simulator is the next best choice; however, generating a realistic simulation at very high TPS with ease of configurability is a formidable challenge. When dealing with multiple application or transport protocols, you would be...
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 ...
We are given a desktop platform with Java 8 or Java 9 installed and seek to find a way to deploy high-performance Java applications that use Java 3D and/or Jogl without having to run an installer. We are subject to the constraint that the applications be signed and deployed so that they can be run in a trusted environment (i.e., outside of the sandbox). Further, we seek to do this in a way that does not depend on bundling a JRE with our applications, as this makes downloads and installations rat...
Widespread fragmentation is stalling the growth of the IIoT and making it difficult for partners to work together. The number of software platforms, apps, hardware and connectivity standards is creating paralysis among businesses that are afraid of being locked into a solution. EdgeX Foundry is unifying the community around a common IoT edge framework and an ecosystem of interoperable components.
DX World EXPO, LLC, a Lighthouse Point, Florida-based startup trade show producer and the creator of "DXWorldEXPO® - Digital Transformation Conference & Expo" has announced its executive management team. The team is headed by Levent Selamoglu, who has been named CEO. "Now is the time for a truly global DX event, to bring together the leading minds from the technology world in a conversation about Digital Transformation," he said in making the announcement.
In this strange new world where more and more power is drawn from business technology, companies are effectively straddling two paths on the road to innovation and transformation into digital enterprises. The first path is the heritage trail – with “legacy” technology forming the background. Here, extant technologies are transformed by core IT teams to provide more API-driven approaches. Legacy systems can restrict companies that are transitioning into digital enterprises. To truly become a lead...
Digital Transformation (DX) is not a "one-size-fits all" strategy. Each organization needs to develop its own unique, long-term DX plan. It must do so by realizing that we now live in a data-driven age, and that technologies such as Cloud Computing, Big Data, the IoT, Cognitive Computing, and Blockchain are only tools. In her general session at 21st Cloud Expo, Rebecca Wanta explained how the strategy must focus on DX and include a commitment from top management to create great IT jobs, monitor ...
"Cloud Academy is an enterprise training platform for the cloud, specifically public clouds. We offer guided learning experiences on AWS, Azure, Google Cloud and all the surrounding methodologies and technologies that you need to know and your teams need to know in order to leverage the full benefits of the cloud," explained Alex Brower, VP of Marketing at Cloud Academy, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clar...
The IoT Will Grow: In what might be the most obvious prediction of the decade, the IoT will continue to expand next year, with more and more devices coming online every single day. What isn’t so obvious about this prediction: where that growth will occur. The retail, healthcare, and industrial/supply chain industries will likely see the greatest growth. Forrester Research has predicted the IoT will become “the backbone” of customer value as it continues to grow. It is no surprise that retail is ...