Blog

Last call for Java Swing: The costs of tech debt are rising, and it’s time to modernize

By  
Lilli Salo
Lilli Salo
·
On May 24, 2024 4:18:12 PM
·

Tech debt is a massive problem with consequences in store for societies, governments, and individual companies, from small business to enterprise. 

Last call for Java Swing: The costs of tech debt are rising, and it’s time to modernize

According to 2022 CISQ research, the technical debt that the US economy has developed would require $1.52 trillion to fix. As time goes on, this accumulated technical debt costs $2.41 trillion a year in security failures, operational issues, failed projects, and ongoing maintenance. 

We’re talking trillions. Though these numbers might seem big and abstract at first glance, they’re not costs that companies can abstract out. 

Sonar research from 2023 adds to the picture: technical debt costs organizations $306,000 annually for codebases of more than one million lines. In an age of scarce technical talent, technical debt results in the loss of 5,500 developer hours, all spent on remediation instead of innovation. 

There’s no “one solution fits all” here, but opportunities exist. Legacy technology creates technical debt at a rate that dwarfs modern systems. If companies can modernize legacy applications—chief among them applications built on Java Swing—they can squash a major source of technical debt and redirect resources from maintenance to innovation and growth.

Frame 2-1

Before and after: Legacy Java Swing application modernized with Vaadin Flow. Learn more about IZUM's migration project.

The state of the Java Swing ecosystem

When evaluating legacy technologies, it’s tempting to assume that “old” means “legacy” and that old software necessarily needs replacement. This just isn’t true. Modernization is a little trickier than that. Java, for example, isn’t legacy, but applications built on Java Swing, a GUI toolkit, often are. Here, we’ll cover a brief history of Java, Java Swing, and the constraints that Java Swing applications run into today.

A brief history of Java Swing

Released in 1996, Java remains a robust and versatile programming language (2023 StackOverflow research shows that 30% of professional developers still use Java). 

However, many Java applications, especially from long ago, weren’t programmed from raw Java—they were built on top of Java Swing, a once-popular GUI toolkit. Although Java is healthy, most applications built on Java Swing are approaching or already meet legacy status.

Java Swing was once an extremely popular way to create desktop applications but, over the years, the world has shifted from desktop applications to mobile and web platforms. Fewer people are building pure desktop applications, and fewer users prefer pure desktop applications, both issues that make Java Swing less relevant and applications built on Java Swing less viable. 

It’s for reasons like these, not sheer age, that companies need to modernize. Companies need to reevaluate their reliance on Java Swing, because the baselines for software performance, security, and scalability are rising, and it will soon be unsustainable for applications built on Java Swing to keep up.

Java Swing today

When companies evaluate their usage of Java Swing, they can’t be vague. If you want to justify modernizing Java Swing, you need to take a close look at its weaknesses. 

  1. Compatibility

    When Swing was popular, back in the late 1990s and early 2000s, developers could write a Swing application and, for the most part, trust that it would work across most devices. Nowadays, this isn’t true. Most devices, such as iPads, can’t run Swing applications well, and maintaining the systems necessary to glue these applications together is costly. A key example of this issue is that Java Swing relies on physical pixels instead of device-independent pixels.

  2. Dependencies and performance

    Older systems depend on many more variables, components, and workarounds. The more complex and diverse these dependencies are, the more fragile the system becomes, especially as the underlying technologies age. All the while, performance issues can accrue over time, making the original legacy application slower and slower. Java Swing uses a double-buffering system, for example, which doesn’t allow developers to make use of now-ubiquitous GPUs. 

  3. Maintenance and migration costs

    Legacy technologies tend to accrue more technical debt with worse consequences than more modern technologies, meaning they often require major remediation efforts, such as refactoring or full-scale migration. At first glance, migration costs can be intimidating, but the cost of migration is unlikely to decrease. 
  4. Slow and costly development

    When you develop for the web, you can deploy new features quickly and efficiently, all the while ensuring that all users are on the correct version. In contrast, delivering and synchronizing updates across legacy desktop applications can be slow and laborious.

  5. Difficulty staffing

    Fewer and fewer developers are learning Java Swing in class or on the job, resulting in ongoing staffing challenges that will constrain the building of high-quality development teams. Already, few colleges teach Swing, and Swing doesn't appear once in a list of dozens of admired frameworks and libraries in the previously cited StackOverflow research. Although developers are frequently able to adopt practices across languages, Swing is aging out of that possibility. When Java Swing was at its most popular, developers had to be able to write multithreaded applications, for example, but current developers rarely need to do so. Hiring a team that knows about system engineering just to write a business application is only going to get harder. 
  6. Security vulnerabilities

    Over time, old systems accumulate vulnerabilities as bad actors expose weaknesses, and missing patches lead to weaknesses. A data breach costs, on average, almost $10 million and, as organizations work to comply with privacy laws, including the General Data Protection Regulation (GDPR), the California Consumer Privacy Act (CCPA), and the Health Insurance Portability and Accountability Act (HIPAA), security compliance can be a make-or-break feature for maintaining contracts in many industries.
  7.  Rise of viable alternatives

    Java Swing was popular for a long time but, as the technology aged, alternatives have emerged that offer a smooth replacement. Some of these alternatives include Vaadin, a web application framework for building rich web UIs in Java; JavaFX, a series of graphics and media packages that developers can use to build client applications across platforms; SWT, a graphical widget toolkit made for Java by IBM; and Jetpack Compose for Desktop, a UI toolkit for Kotlin.

Modernization: If not yesterday, then today

“The best time to start was yesterday. The next-best time is now.” This quote could adorn a motivational poster, but it could also be the motto of your next modernization effort. The imperative to modernize becomes clear when you weigh the costs and benefits. 

Why modernize

Modernizing legacy technologies is a complex problem, but the willingness to take on the challenge often comes down to the question of ROI. However, determining ROI is only possible if you weigh both the costs of sticking with legacy technology and the benefits of a modernized platform. 

In the previous section, we covered some of the most common struggles companies have with Java Swing applications, ranging from compatibility issues to endless security problems. But often, even when companies have a broad sense of these costs, modernization efforts can still face delays. 

In these cases, companies tend to focus too much on the costs of the previous system and not think enough about how a modernized system removes constraints and enables new opportunities. 

Benefits of modernizing your Java Swing applications

Benefits of modernization

At too high a level, the benefits of modernization can seem abstract. As you look for ROI, walk through the benefits and examine each, as well as how each benefit amplifies other benefits. 

Look, too, at the costs of temporary solutions like Citrix, which facilitate remote work by providing virtual access to desktop applications and resources. These solutions can appear like usable strategies, but they’re inherently short-term. Maintaining subscriptions for these services can be expensive in the long run, especially when you weigh these costs against the benefits of taking the leap toward full modernization. For example, some users have reported Citrix insisting on a three-year contract and pushing steep upsells

  1. Developer productivity

    As Java Swing ages, developers will have less access to new developer tooling. Many Swing applications have dependencies on older IDEs, for example, because WYSIWYG development was a priority back when Swing was popular. Now, however, many developers would prefer modern IDEs. With a modernized system, developers can adopt better tooling and work more efficiently and effectively. Vaadin, for example, abstracts the details of browser execution, allowing developers to focus better and stay in a flow state. 
  2. Efficiency and speed

    The more Java Swing falls out of date, the slower the applications built on it will be, and the less able even skilled developers will be to improve performance. With a modernized system, the developers themselves will be faster, too. With feature updates available via the web, for example, developers can stay up to date without waiting for desktop upgrades.  
  3.  Better security features

    Security has evolved dramatically over the years in terms of both security tooling and practices and the sophisticated techniques of bad actors. Modern frameworks are built on better assumptions and have access to better security tools and integrations. Vaadin, for example, never exposes its internals to the browser, unlike client-driven frameworks, making it inherently more secure.

  4. Improved User Experience

    Despite the short-term costs, modernization will pay off over time as modernized apps perform better and cost less. When the desktop-only era ended, back in the 1990s, many platforms struggled to adapt. As consumer behavior changed, the inability of these platforms to keep up resulted in software that people found less and less satisfactory. With modernized systems, developers can reuse code without refactoring it as often—all the while trusting that it will work better across more platforms. 

Unlock the value of legacy technology

Legacy technologies shouldn’t be treated with disrespect. As Marianne Bellotti writes in Kill It With Fire: Manage Aging Computer Systems (and Future-Proof Modern Ones), “Legacy technology exists only if it is successful. These old programs are perhaps less efficient than they were before, but technology that isn’t used doesn’t survive decades.” 

Legacy systems are old, but they still contain a lot of value. By unlocking this potential, you benefit your company (if you want to keep growing it) or boost the sale price (if you want to exit). Rewriting systems from scratch is enormously expensive and often ultimately unnecessary, given this already existing value, meaning that modernization and migration are frequently the better paths. 

That value, as significant as it is, often lies dormant—invisible to potential buyers. Gene Marks, a small-business consultant, explains, “Unless their tech is up to date, the price of their business will be significantly affected. This is not a tech issue. It’s a valuation issue.” 

When it comes to valuation, appearance can be just as important as functionality. If a founder is considering selling their company after 20 years, for example, the presence of old software systems can create a perception of technical debt, even when the software is basically functional. 

As Marks says, any buyer “would immediately discount their purchase price to compensate for the costs of upgrading or replacing these old systems.” The perception of technical debt can then damage the sale price as the founder tries to exit. But if the founder updates their systems, integrates them with new ones, and makes managing overhead easier, the sale price can recover.

Companies can best address both the reality and appearance of technical debt by modernizing their technologies and migrating to modern, web-based systems.

Watch our recent webinar to learn how Vaadin’s Modernization Toolkit automates the modernization process, making it possible to achieve modern, efficient applications faster.

Give your software a second life

Throughout this article, we’ve mentioned a range of flaws endemic to Java Swing applications. However, these flaws are all non-functional attributes of software systems that have supported businesses for years—sometimes decades. 

Modernization isn’t about tearing old systems down and constructing new ones; it’s about giving a second life to a system that still has much more value to offer. When you migrate, you can transport a system that retains all the functional attributes that have supported you over the years to a modern version that, in the process, replaces the non-functional problems that have restrained you for nearly as long. 

By migrating to Vaadin, which we make easy with our Modernization Toolkit, you can unlock the value of your formerly restrained systems and give your software a second life. 

Lilli Salo
Lilli Salo
Lilli joined Vaadin in 2021 after delivering content for various international SaaS startups. She enjoys the creative challenge of transforming complicated topics into clear and concise written material that provide value to the reader.
Other posts by Lilli Salo