No New APIs?

Java 6u10 is not called Java 7. Because of this name — and the rules associated with JDK update releases — no new APIs can be added. But is this really the full story? For example, with 6u10, you can create translucent and shaped windows.

However to really leverage this feature, you need to use the AWTUtilities class. What’s that?

The translucent and shaped windows feature is available through the new com.sun.awt.AWTUtilities class. Note that this class is not part of an officially supported API.

By back-dooring stuff into “com.sun.*” packages, we can still call this an “update release”. But seriously, folks. This is just an API semantics game. It reminds me of a famous Clinton quote:

That depends on what your definition of “is” is

So I guess this depends on what your definition of “API” is. Is Sun producing demo apps and publishing articles describing how to use this new class? Yes. Are they calling it an “API”? Sort of, but within the confines of what an update release allows. Does this mean I should use it?

Translucent and shaped windows are huge new features I have wanted for years. This is exactly the sort of thing rich client applications will use, but I also want my Swing apps to run on all platforms.

Will Java 6u10 be ported to OSX, and when? Will the com.sun.awt.AWTUtilities class work just through a simple JAR file addition to the boot classpath, or does this require OS-specific native code?


Eric Burke Says:

One more question…will the first JavaFX implementation use these new APIs behind the scenes, and how will that affect portability?

Ophir Radnitz Says:

Thank you. Brilliant post.

Aekold Says:

But official API is not changed. Backdoor classes existed in Java always, and many projects used it behind the scene. Like SwingUtilities2 or Base64Decoder, didn’t you ever saw it?
So, if you are writing legacy application and want it to run everywhere – transparency is not for you. But if you are mature hacker and using undocumented API – you can do it. Think of it like of technology preview, and hope it will be added to official API of Java 7.

Eric Burke Says:

But why not just call it Java 7, making it part of the official API right away? It feels like we’re making compromises in the name of keeping the name “6u10″ instead of moving to “7″.

Alex Miller Says:

From having worked on several software products over the years, this sort of release and API game is just the tip of the standard-working-practice for releases (and certainly not Sun specific). Customers want features, and they want them now. Products release at a certain rate, usually determined by a variety of forces outside your control (fiscal cycles, industry cycles, engineering cycles, etc). Rarely do these two worlds align.

Another example – certain federal agencies have very strict rules over what kind of certification must be done for a “major” or “minor” release and huge games are played to stay within these rules while avoiding security recertification (an annoying and lengthy process).

As to your questions – if you can deal with the restrictions and are willing to modify your app when “official” support exists in an API, then go for it. If not, then tough. Wait for Java 7. I understand the frustration but any release schedule is walking a tightrope – for a product as complicated and widely used as Java it’s extremely challenging I’m sure.

In fact you can use the AWTUtilities w/o any problems on any platforms now. Go check how to do it here:
http://weblogs.java.net/blog/joshy/archive/2008/06/java_doodle_fad.html