Reputation: 842
In Java, what is the difference between JTextField
and JFormattedTextField
?
I mean when should I use JFormattedTextField
instead of JTextField
?
Upvotes: 3
Views: 2480
Reputation: 20755
JFormattedTextField differs from JTextField in that it can support
To know more about it Click here and here
Upvotes: 5
Reputation: 1427
JTextField
is used for plain text.
JFormattedTextField
is a class that extends from JTextField
and it is used to set any format to the text that it contains (in example, phone numbers, e-mails, dates, etc.).
If you don't need to set any special format to the textfield, it's recommendend to use JTextField
.
Upvotes: 1