What is a simple way to create a text field (or such) that only allows the user to enter ints/double

Posted by badpanda on Stack Overflow See other posts from Stack Overflow or by badpanda
Published on 2010-03-24T17:39:37Z Indexed on 2010/03/24 17:43 UTC
Read the original article Hit count: 219

I am looking for a way to ensure that my text field (JTextField, JFormattedTextField) is returning a double or int rather than a string when I call .getText(). What is the best way to do this (if possible)?

Thanks!

badPanda :D

© Stack Overflow or respective owner

Related posts about jtextfield

Related posts about jformattedtextfield