Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

JFormattedTextField or JTextField

  Asked By: Don    Date: Oct 13    Category: Java    Views: 1225

I'm trying to create some textfields which return
doubles and integers as well as strings. JTextFields
only produce strings, so I suppose I need to use a
JFormattedTextField. I have limited time and Sun's
JFormattedTextField tutorial is a little lengthy and
scary for a novice Java programmer, so if there's
somebody who has the heart to help me figure out the
code, that would be much appreciated.

Here is a list of what I need the text fields to
return along with their length:
1) String, length 30
2) int, length 30
3) double, length 8 with up to 3 decimal places

I need to know how to implement the type and length
and I don't want any comma's to show up in my

Also, how do I omit the entry of certain characters in
a text field?