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

Related Topics: Java IoT

Java IoT: Article

Swing Low, Swing High, Sweet Desktop

Swing Low, Swing High, Sweet Desktop

Sun has made two significant announcements recently in the Java desktop space: Java Desktop Integration Components (JDIC) (jdic.dev.java.net) and Java Desktop Network Components (JDNC) (jdnc.dev.java.net), both of which are open sourced under an LGPL.

JDIC is essentially about allowing Swing access to more native platform resources, such as embedding the operating system's Web browser in a GUI, or enabling more control over taskbar support. I think the goal of elevating the function point of the end-user's experience, so that a Java application looks and behaves no differently for other desktop programs, is wonderful. I won't belabor the obvious point, but for me JDIC is a missed opportunity for bringing Swing and SWT toolkits closer together, as the latter already provides native embedded browser and taskbar support. Both toolkits have farther to travel along this road, as users demand more and more platform fidelity from their programs. All I sincerely hope, for Java's sake, is that the decision to forgo the chance to use the CPL open sourced SWT as the basis for JDIC was made for sound business reasons, not bruised egos.

Java Desktop Network Components is a project that has always promised to be successful because its roots lie in trying to simplify the programming model of writing GUIs that connect to back-end databases or services. By implementing JDNC, developers have helpfully adopted a layered approach.

Swing Extensions
The extensions include new UI classes such as JXTable, JXTree, JXEditor, or JTreeTable. These extend the basic Swing toolkit to provide a set of controls that are designed out of the box to work with data. The JForm class, for example, is a nicely thought-out control that helps you easily create a data-bound set of components. What's nice about the Swing extensions is that they can be used without the rest of JDNC and, with the sorting and filtering enhancements, represent a nice turn of the crank for Swing that any GUI developer will hopefully benefit from. Another welcome feature is an overhaul of the way actions work, allowing more flexibility. I believe there might be plans to roll the Swing extension packages into a future release of J2SE. Such a move would be great for the general Swing developer and would provide a welcome set of base enhancements.

JDNC Components
These mirror the Swing extensions with the prefix JN, so for JXTable there is JNTable, JEditor has JNTable, and so on. These are standard JavaBeans so they should be easy to integrate into GUI builders and intuitive to Java programmers; however, rather than subclass their visual peers, they wrap them instead. I think this is a great decision, and is rooted in the desire to simplify the programming model that currently includes a lot of low-level properties for Swing controls. By using delegation, the API that's surfaced for the developer is one designed around the data binding and access capabilities of the control. There are some nice new listener interfaces as well, such as org.jdesktop.swing.event.ProgressSource that allows a DataSource to signal the progress and completion of a long-running task. The whole experience using the JNComponents shows that they have been well thought-out and well implemented.

JDNC Markup Language
The purpose of this layer is to allow the nonprogrammer to easily customize JDNC components using XML. One of the main benefits I can envisage with the XML configuration of components is not that the unskilled developer will use this in preference to cutting Java source code. Presumably, said person is going to be using a GUI builder-like tool that should be able to hide XML or Java implementations equally well. XML, however, offers the advantage of being easy to create and manipulate at runtime, so GUI behavior can be manipulated dynamically (perhaps the XML prepared by a servlet as the result of a user query) and less hard coding need occur in the actual client layer. One of the goals of any large business GUI application must be to capture as much as possible in rules and rely less on hard-coded, bespoke client screen logic. Having XML prepared by a rule engine that consumes a model definition of the application and serves this up to JDNC to implement the wiring logic might well be the answer. This could become a very powerful usage scenario.

Open Source
JDNC has been released as an open source project, which is interesting because it's outside the usual JSR/JCP process. I'm very encouraged by this, as I hope it will benefit from the rapid progress that other open source projects have enjoyed, and because the end users of JDNC are programmers trying to build business applications using Swing. It's an invitation for everyone who has done this for the last few years to bring the benefit of their knowledge, gripes, suggestions, and, ultimately, code to the table. If you've had to build your own data access framework on top of Swing, or wished one was there, I strongly encourage you to visit the JDNC homepage to become involved in the project and give the developers the benefit of your experience and ideas. I believe JDNC is one of the most exciting things to come along in the GUI space in any language for many years, and I think it has the potential to take Java client programming to a whole new level.

More Stories By Joe Winchester

Joe Winchester, Editor-in-Chief of Java Developer's Journal, was formerly JDJ's longtime Desktop Technologies Editor and is a software developer working on development tools for IBM in Hursley, UK.

Comments (0)

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.

IoT & Smart Cities Stories
Cloud-enabled transformation has evolved from cost saving measure to business innovation strategy -- one that combines the cloud with cognitive capabilities to drive market disruption. Learn how you can achieve the insight and agility you need to gain a competitive advantage. Industry-acclaimed CTO and cloud expert, Shankar Kalyana presents. Only the most exceptional IBMers are appointed with the rare distinction of IBM Fellow, the highest technical honor in the company. Shankar has also receive...
DXWorldEXPO LLC announced today that ICOHOLDER named "Media Sponsor" of Miami Blockchain Event by FinTechEXPO. ICOHOLDER gives detailed information and help the community to invest in the trusty projects. Miami Blockchain Event by FinTechEXPO has opened its Call for Papers. The two-day event will present 20 top Blockchain experts. All speaking inquiries which covers the following information can be submitted by email to [email protected] Miami Blockchain Event by FinTechEXPOalso offers sp...
Headquartered in Plainsboro, NJ, Synametrics Technologies has provided IT professionals and computer systems developers since 1997. Based on the success of their initial product offerings (WinSQL and DeltaCopy), the company continues to create and hone innovative products that help its customers get more from their computer applications, databases and infrastructure. To date, over one million users around the world have chosen Synametrics solutions to help power their accelerated business or per...
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.
@DevOpsSummit at Cloud Expo, taking place November 12-13 in New York City, NY, is co-located with 22nd international CloudEXPO | first international DXWorldEXPO 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 t...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...
Charles Araujo is an industry analyst, internationally recognized authority on the Digital Enterprise and author of The Quantum Age of IT: Why Everything You Know About IT is About to Change. As Principal Analyst with Intellyx, he writes, speaks and advises organizations on how to navigate through this time of disruption. He is also the founder of The Institute for Digital Transformation and a sought after keynote speaker. He has been a regular contributor to both InformationWeek and CIO Insight...
Digital Transformation is much more than a buzzword. The radical shift to digital mechanisms for almost every process is evident across all industries and verticals. This is often especially true in financial services, where the legacy environment is many times unable to keep up with the rapidly shifting demands of the consumer. The constant pressure to provide complete, omnichannel delivery of customer-facing solutions to meet both regulatory and customer demands is putting enormous pressure on...
Machine learning has taken residence at our cities' cores and now we can finally have "smart cities." Cities are a collection of buildings made to provide the structure and safety necessary for people to function, create and survive. Buildings are a pool of ever-changing performance data from large automated systems such as heating and cooling to the people that live and work within them. Through machine learning, buildings can optimize performance, reduce costs, and improve occupant comfort by ...
SYS-CON Events announced today that IoT Global Network has been named “Media Sponsor” of SYS-CON's @ThingsExpo, which will take place on June 6–8, 2017, at the Javits Center in New York City, NY. The IoT Global Network is a platform where you can connect with industry experts and network across the IoT community to build the successful IoT business of the future.