Home  |  Software Components  |  Examples  |  Books  
This applet is a demo of our BigDecimalField Java Bean. You will need a browser that supports Java 1.1 to use it.

BigDecimal Field Example

Sorry, your browser does not support Java Version 1.1, or that feature is disabled.

The BigDecimalField is the first edit field in the applet. All other fields (except scale) are standard AWT components.The applet doesn't do anything productive. It just allows you to enter numbers into the BigDecimalField and observe the events that the bean produces and to see how the bean reacts to various settings and entries.

BigDecimalField Demo

  • Choose different locales from the choice field near the bottom of the applet to see their effect on formatting. These locales will show a variety of formats:
    English (Canada) English (United States)
    Finnish (Finland) German (Germany)
    Italian (Switzerland) Macedonian (Macedonia)
    Note: In some cases there may be only one (or no) languages listed in the "Choose a Locale" choice field and you will not be able to use this demonstration.
     
  • Type a new number into the BigDecimal field. Be sure to use the formatting characters that are appropriate for the locale setting. Press Enter or just move the focus to another field. A propertyChange Event will appear in the event field.
     
  • Try different settings for scale and rounding. Notice that changing the scale, rounding, or locale does not fire a property change. An event is fired only when you enter a new number or use the setValue(BigDecimal) method from an application.
     
  • Enter a letter or an illegal format character for the locale such as a "*" into the BigDecimalField. You will hear a beep (which can be disabled) and the character will be ignored. Multiple character errors such as -1-23,, or reversal of the grouping and decimal separators will be caught when you press enter or shift the focus to a new field. In that case a beep will be sounded and the last valid number will be displayed again.

 

 
Copyright ©1998-2004 GetObjects.com  All Rights Reserved
Privacy | Legal & Terms of Use | Trademarks | Feedback | About