Monday, March 3, 2003

Java has always centered its identity around it cross platform support. Although they have never deviated from this focus, there has always been a wandering direction as to how to implement this cross platform support on such a wide variety of machines. AWT took the approach of the lowest common denominator. Swing choose to emulate a UI that would behave the same on all platforms. At first, Sun even refused to add support for the right mouse button; after all, if most Java programs require a two button mouse to work, is the language really cross platform?

I believe any language that is totally cross platform, would have to be distilled to the point of uselessness. As critics point out, not every aspect of Java is cross platform. Java programmers can write some very nice, cross-platform code; at the same time, they are not normally excluded from tapping into the platforms strengths:

  • A J2EE project doesn't have the same set of constraints as a J2ME project.
  • A Unix program can have a tree structure
  • A Windows program can have right mouse button support

What about the windows keyboard?

For a Java program to be as usable as it's native counterparts, it should have the ability to respond to all the same key events. I understand that Sun has a delicate balance of functionality and compatibility to maintain. I didn't expect the Swing API to fire a right-mouse-click event on the currently focused component when the context menu button was pressed on my Microsoft keyboard (although that would have been really cool). I did expect, Sun to allow me to trap the key event on my own.

It turns out, that Sun (in some apparent fear of developers like myself), decided to strip out any key events it didn't recognize and replace them with a keycode of zero. I can't tell a windows key from a cash register key without dropping down to another language.

JDK 1.4.2 is due out in a couple months. Features for 1.5 are already being leaked. If you agree with me on this, vote for feature request 4352104 at Sun's Bug Parade so we can get the fix as soon as possible.



Post a Comment

Subscribe to Post Comments [Atom]

<< Home