Jive Community Forums


  JavadesktopFAQ JavadesktopWIKI JavadesktopBLOG JavadesktopPROJECTS JavadesktopHOME javadotnet javadesktopFORUMS javadesktopARTICLES

Introducing JDIC

Desktop Integration for Java Applications

June 1, 2004


Sun has launched the JDesktop Integration Components (JDIC) project on javadesktop.org. JDIC will enable applications written for the Java™ platform (Java applications) to integrate more seamlessly with their native desktop environment. Initially the project supports features such as embedding the native HTML browser, programmatically opening the native mail tool, using registered file-type viewers, and packaging JNLP applications as RPM, SVR4, and MSI installer packages. As a bonus, an SDK for developing platform-independent screensavers is included.

This article has the following sections:


Desktop Integration of Java Applications Today

Many factors — including the rapidly growing market share of Linux on the desktop and the desire to close the usability gap of browser-based applications vs. rich desktop applications — have made the Java platform an increasingly popular choice for non-browser-based desktop applications: Developers have adopted Java Web Start technology to build applications that can be deployed at the click of a link while providing the same rich user experience that has traditionally been the domain of full-featured desktop applications. The Sun Java Desktop System has made the Java platform its native development platform for desktop applications.

Unlike many desktop applications, Web pages are traditionally designed to have a platform-independent appearance that looks the same in each browser they're displayed in. Often they break with the paradigms of the desktop, using different GUI elements and styles. Developers favor this approach because it minimizes development and testing work. Outside of the browser, however, most users expect applications to seamlessly integrate into the desktop and follow its user interface guidelines.

The Java platform has enabled this level of seamless desktop integration with functionality such as its native look and feels (XP, GTK, Aqua), drag and drop, and clipboard support. Java Web Start comes with features to place application shortcuts into the start menu and on the desktop. The 1.5 release of the Java 2 Platform, Standard Edition (J2SE™ platform) will further enhance desktop integration, enabling applications deployed using Java Web Start to be registered with file types and enabling the native look and feel for all dialogs provided by the Java platform (for example, the Java control panel).

Developers who want to go beyond what already exists in the Java platform, however, have limited choices. Many developers resort to using JNI to implement the enhancements they need, an approach that often leads to platform dependence and decreasing the market potential for the application. Projects like java-gnome provide direct bindings to the native APIs of a platform, but these suffer from the same problem and limit use of the application to one platform.



The JDIC Project

To enable better native platform integration, Sun is launching the JDesktop Integration Components (JDIC) project, an open-source project hosted on javadesktop.org. Its mission is to take cross-platform Java desktop integration to the next level.

JDIC is a set of cross-platform APIs that abstract the contracts between an application and the desktop it runs on. JDIC-based applications will run on any platform JDIC is ported to and will realize the behavior associated with these contracts in a way that's suitable for each particular desktop environment.

The JDIC approach is possible because many desktop concepts, such as an HTML rendering engine, are implemented across all environments. Additionally some desktop services, such as the icon tray, are an enhancement to an application rather than necessary to its operation. Such features can be left unimplemented on platforms where the service is not available.

Sun is seeding the JDIC project with a number of interesting integration components that are already implemented on Microsoft Windows, Linux, and Solaris. These components have been selected by customer demand and by considering what will happen as developers move from pure HTML-based applications to rich clients.

As developers move to rich clients, they will need to replace functionality that was provided by the browser. In addition to the many features that the Java platform provides, an HTML browser supports the following:

  • Embedding HTML content
  • Starting desktop file viewers on content unknown to the browser
  • Sending e-mail using the desktop mailer via mailto: URLs
  • Dispatching URLs into new browser instances

JDIC currently supports all of the above features for Java applications. JDIC also comes with a tool to package JNLP applications as RPM, SVR4, or MSI files. Finally the SaverBeans Screensaver SDK incubator project is included in JDIC, providing an SDK to create write-one-run-anywhere (WORA) screensavers for Microsoft Windows, Linux, and Solaris.

A guiding principle in the design of the JDIC APIs has been simplicity. The emphasis is on making the most common use cases easy to code, rather than exposing more advanced functionality for special cases. As an example the browser-embedding API allows you to very easily embed an HTML page in your application, but it wouldn't be suitable for writing a complete Web browser.

JDIC is an exploratory project. While you're welcome to use JDIC in your products, be aware that all current APIs are subject to change. JDIC components will be considered for inclusion into the J2SE platform when they have matured adequately.

Join us in identifying the desktop integration functionality most needed in modern desktop applications, and work with us on their design and implementation!



The demonstration programs pictured in this section show some of JDIC's capabilities. You can run the demos with Java Web Start by clicking the [Run Demo] links. For more information about the demos, see the Demos section of the JDIC home page.

Browser [Run Demo]

This demo, shown in the following snapshots, uses the embedded browser functionality provided by the org.jdesktop.jdic.browser package. 

Microsoft Windows
Solaris Browser Picture
Linux  Browser Picture
MS Windows  Browser Picture


Desktop [Run Demo]

This demo shows the functionality in the org.jdesktop.jdic.desktop package. The items in the popup menu Open, Edit, Print, Browse, and Mail to... correspond to methods in the Desktop class.

Microsoft Windows
Solaris Browser Picture
Linux  Browser Picture
MS Windows  Browser Picture



Where to Find Out More

Read or Post a Comment

About javadesktop.org and java.net

javadesktop.org is a java.net community for developers of applications with rich client interfaces. java.net is a Web site used by the developer community that expands the Java technology portfolio of applications, tools and services in applied areas of technology and vertical industry solutions. More than 52,000 developers worldwide have joined the java.net collaborative community, and are engaged in more than 900 projects ranging from Java technology-based games development to desktop technologies to enterprise development such as Java Web services. java.net is sponsored by Sun, the creator and leading advocate of Java technology, with editorial resources and technology infrastructure provided by CollabNet, Inc. and O'Reilly & Associates.