Merlin « JVM « Java Articles

Home
Java Articles
1.Build Deploy
2.Class
3.Core Library
4.Data Types
5.Database JDBC
6.Design
7.Development
8.File Input Output
9.Graphics Desktop
10.J2EE Enterprise
11.J2ME Wireless
12.JVM
13.Language
14.Library Product
15.Network
16.Security
17.SOA Web Services
18.Test
19.Web Development
20.XML
Java Articles » JVM » Merlin 

1. Magic with Merlin: Formatting numbers and currency    ibm.com

If you're from the United States, you place a comma in large numbers to designate thousands and millions (and so on up for every three digits). For floating-point numbers, you place a decimal as the separator between the whole part of the number and the fraction. With money, the currency symbol is $, placed before the amount. If you never travel outside the States or never expect your programs to for that matter, you might not care about formatting currencies in yens (¥) for Japan, pounds (£) for Great Britain, or euros (€) for most of the rest of Europe.

2. Magic with Merlin: Indeterminate progress bars    ibm.com

Starting with the Merlin release, JProgressBar supports yet another mode -- indeterminate. You use this mode for long tasks with no fixed number of steps. It shows constant animation to indicate something is going on, but it doesn't indicate what percentage has completed. If -- or when -- you determine how long a task will take, you can switch back to determinate mode. While in indeterminate mode, though, JProgressBar shows a bar that goes back and forth within the display area.

3. Magic with Merlin: Maintaining insertion order    ibm.com

J2SE 1.4 introduces two new implementations to the Java Collections Framework, LinkedHashSet and LinkedHashMap. The advantage of these additions is that a hashed collection now maintains two paths through its elements. In addition to the standard hashing relationship, there is now a linked list that traverses through the collection. Under normal circumstances, this new second path would follow the insertion order, meaning that the iterator for the collection will return the elements in their insertion order (not in the order that their hashing codes have them incorporated into the collection), but LinkedHashMap supports a second ordering option: maintaining the linked list in access order instead of insertion order.

4. Magic with Merlin: J2SE 1.4.2 gets two new look-and-feel designs    ibm.com

The Swing architecture provides a pluggable look-and-feel framework. The framework offers a standard way, for instance, to make the font of all components 8-point bold Lucida, without having to change every call to create a component. You just plug in a new setting in the look and feel and magically everything picks up the changes. You can even change the overall style of the GUIs by setting the look and feel. Previously, J2SE 1.4 offered look-and-feel designs for platform-specific UIs like Microsoft Windows and Motif. It also provided a cross-platform UI called Metal that was specific to the Java platform, but looked the same no matter which desktop a user was on.

5. Magic with Merlin: Scrolling tabbed panes    ibm.com

The JTabbedPane control is a container that allows a user to access different component sets based on which tab he or she selects. When you're designing a user interface with JTabbedPane, it's not uncommon to specify many tabs. A problem arises if the user's screen size is smaller than expected; in this case, the tabs will wrap across multiple rows. Wrapping causes the expected screen space for the components on each tab to decrease. The area decreases proportionally to the number of rows needed to display the tabs across the JTabbedPane -- a user interface engineer's nightmare.

6. Magic with Merlin: Character sets    ibm.com

At the risk of stating the obvious, computers only understand numbers. What's perhaps less obvious, however, is that because they only understand numbers, computers need to use some form of mapping of numerical values to corresponding characters so that they can display text. It is these mappings (or character sets) that permit the computer to understand text. For instance, early desktop computers used ASCII for just such a mapping. When a computer that uses ASCII stores the numbers 72, 101, 108, and 112, it knows to display the word "Help," because in ASCII the number 72 is the value of H, 101 is e, 108 is l, and 112 is p. If, however, that computer was an early IBM mainframe using EBCDIC (rather than ASCII), the word "Help" would have been represented by the numbers 200, 133, 147, and 151.

7. Magic with Merlin: Focus, focus, focus    ibm.com

Some of the lingering issues with Swing-based GUIs include how to manage focus (which component has priority to receive keyboard input), determining what component has it, and how to traverse from one component to the next. Because Swing is built on top of the Abstract Window Toolkit (AWT), the management of component focus relies on the underlying focus management in the AWT. Past releases of the Java platform relied on the native window manager to assist with focus management, so while developers might have thought focus control was within their Java application, that wasn't always the case. Because of the reliance on the underlying native focus system, numerous platform "inconsistencies" appeared.

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.