When you double-click an application, how do you know that it has been written in Java? Is it important that you know?
In many cases, the way you know that your application isn't native is that something doesn't feel quite right. The buttons look funny or you see "Quit" where you expect "Exit" or the keyboard accelerators aren't what you expect. Today Joshua Marinacci kicks off a three part series on tuning your Java desktop apps to look and feel more like native apps. In Make Your Swing App Go Native, Part 1 , he begins
with a look at the design of menus and the addition of visual alerts that give your Java applications more of the look and feel that your users are accustomed to.
There are obvious differences for Mac and Windows users. For Windows users the menu bar lives at the top of each window. The left-most menu is the File menu and it contains menu items for New, Open, Close, Save, and Exit. The first four menu items have keyboard accelerators made up of holding the Control key and pressing N, O, W, and S respectively. The Mac menu bar lives at the top of the screen. Rather than enter a religious war to discuss why there are differences, let's just look at what the differences are. At the left side of the Mac menu bar, you will find the "Apple" menu. Next is the Application menu. The third menu is the File menu. It includes the menu items New, Open, Close, and Save with almost the same keyboard accelerators. In place of the Control key, the user presses the Command (the Apple) key. So where's the Exit? It's not there. The corresponding menu item on a Mac is Quit and it lives under the Application menu with the keyboard short curt Command-Q.
That seems like a lot of differences to account for. Fortunately it is not too bad. The differences in the meta key are handled by a single call. The menu placement is handled (for the most part) by setting a system property. The differences in where menu items live and what they are named are addressed by building on Steve Roy's MRJAdapter library. The other focus of the article is getting your attention with Native user alerts. On the Mac Joshua has used Gregory Guerin's Notifications library. This limits you to targeting J2SE 1.3 and not J2SE 1.4.x. Perhaps Joshua will present a more general solution in a later article. For the Windows side, Joshua extends code he found on Sun's JNI forum.
Also in Java Today begins the week with a link to Berthold Daum's article Tip: Parsing XML documents partially with StAX. StAX is a streaming XML parser with some attractive features. One of them is the ability to not process parts of the XML document. This developerWorks tip shows you examples of two filters you can use with StAX. The first skips all processing instructions and the second allows you to skip entire branches of the XML document.
James Todd has written an article on the JXTA Configuration Extension on the wiki. His examples include the trivial configuration where only a name and password are passed into the Configurator, the use of "of Configurator setters to generate specific configurations", the use of either a Profile or an existing PlatformConfig to seed the defaults, and programatically implementing the Configurator interface.
In Weblogs ,
Jim Cushing says Don't be afraid to be wrong. What a wonderful moment in your life when you can be comfortable with what you don't know. Jim laments that "We're not really paid to learn, though it is a daily part of our jobs, and we certainly aren't paid to be wrong. When we are wrong, it can cost our companies and our customers money. If we're wrong enough times, it can cost us our jobs or our reputations, or both. So we have evolved to be positively petrified of being wrong."
It's why radio stations in the US are so boring. Even most of the, so called, alternative stations have very limited playlists. Just play the hits. Don't take a chance on a record that may lead some folks to change the dial. Rely on the research and not on your guy. Sigh. I'm done with that rant, but you can see that this fear of being wrong is what leads many to stop at a chain and not a local coffee shop or hamburger joint. We may not be right, but we won't be wrong.
O.K., I've calmed down again. Back to software. Jim writes "If we're not afraid to admit we're wrong, we can do something to correct our mistakes or revise our project. Better yet, we'll admit that we neither can be nor need to be right all at once, so we scale down that 125-page document and allow for uncertainty and evolution. As the project progresses, the system will take shape and we adapt the requirements to their environment."
Today in Projects and Communities, take a look at the latest news and features from the Java Games community. Follow the links to stories on the First Televised Video Game Awards or to a developer feature for Chrome. Looking for an easier way to do distributed computing? The Cajo project describes itself as a "small, free library, enabling powerful, dynamic, multi-machine interaction, both within, and between, Java applications" which aims to "simplify the use of RMI."
In today's java.net News Headlines :
- Microsoft to Junk Flagship Products, Cites Java Settlement
- Interview with Onno Kluyt on Metadata
- XPlanner 0.5.2 Released
- WebForum 0.36.000
Registered users can submit news items for the
href="http://today.java.net/today/news/">java.net News Page using our
news submission form.
All submissions go through an editorial review by news director Steve
Mallet before being posted to the site. You can also subscribe to the href="http://today.java.net/pub/q/news_rss?x-ver=1.0">java.net News RSS
Current and upcoming Java Events:
- December 9 Web Seminar: Developing Wireless Applications using MIDP2.0, WMA, and MMA
- December 10-11 Borland Conference France
- December 11 Dallas J2ME User Group
- December 13 DFJUG Christmas
Registered users can submit event listings for the
href="http://www.java.net/events">java.net Events Page using our
href="http://today.java.net/cs/user/create/e"> events submission form.
All submissions go through an editorial review before being posted to the
This blog is delivered weekdays as the
href="http://today.java.net/pub/q/java_today_rss?x-ver=1.0">Java Today RSS
feed. Once this page is no longer featured as the front page of href="http://www.java.net"> java.net it will be archived at href="http://today.java.net/today/archive/index_12082003.html">
http://today.java.net/today/archive/index_12082003.html. You can
access other past issues in the href="http://today.java.net/today/archive/">java.net Archive.