Meaningless Drivel is fun!*
The moose likes IDEs, Version Control and other tools and the fly likes BigDecimalEditor ignores 0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "BigDecimalEditor ignores 0" Watch "BigDecimalEditor ignores 0" New topic

BigDecimalEditor ignores 0

laila NiHai
Ranch Hand

Joined: Oct 18, 2010
Posts: 35
Hello, I used the example of IntegerCellEditor given by Sun and adjusted to BigDecimalCellEditor; however, I cannot get the editor to see 0.0 and 0.01 as a valid entries. Not sure what I am missing... Any help would be greatly appreciated.

Paul Clapham

Joined: Oct 14, 2005
Posts: 18168

So 0 is not a valid input, because it's less than this "minimum" value. As for 0.01, it's probably less than this value too: read the API documentation for BigDecimal, which explains why you should use another BigDecimal constructor instead of the one you used.
laila NiHai
Ranch Hand

Joined: Oct 18, 2010
Posts: 35
Thank you Paul for pointing that out. I completely missed that detail. Thanks! It works great now!
I agree. Here's the link:
subject: BigDecimalEditor ignores 0
Similar Threads
Ascii Validation in Swing.
MaskFormatter in JTable
maxlength for customer id column
Create JTable custom editor to validate againts string data type
JDateChooser in JTable