DID YOU KNOW ? - Number Converters?
Hi All,
DID YOU KNOW?
That the Creator IDE provides a set of converters that you can use to convert component data. If your input field is for numbers, then you most likely need a converter. Converters are also good for formatting dates, times, and currency values. The standard converters, which you can use are located inthe Converters section of the Components Palette.
The Number Converter
Is a type of converter that Converts between java.lang.String values in your component properties and data types of java.lang.Number. The conversion usually applies to the property a component uses to display values and to pick up values entered by users. For example, the Text Field component uses the text property for this purpose.
The Number Converter returns a Long if possible (within the range [Long.MIN_VALUE, Long.MAX_VALUE] and with no decimals), otherwise a Double. If you need the converter to return a numerical type other than Long or Double, or you need to narrow the choice to a specific type. The other lists of converters to choose from include Big Decimal Converter, Integer Converter, Long Converter, Float Converter, Long Converter, Short Converter and Double Converter.
When you bind a component, the IDE normally identifies the data type for you and sets the appropriate converter when you establish a binding to the value property. However, you can also add a converter manually by setting the component's converter property.
We would like to know the following from you :-
1) Why and How are you using Converters in applications you are building?
2) Did you face any challenges while using them?
3) Did you find any cool ways of using these or build any cool custom converters?
4) Any feedback you might want to share about converters to make it easier in using them.
Thanks for all your inputs and for joining in the discussion.
(Note :- This is the continuation of the Threadinar Series - see index at
http://forum.java.sun.com/thread.jspa?threadID=5103424)
K

