Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make a jtextfield having a fixed date format?

I'm having trouble creating a fixed date format using JTextField. Is there a way for JTextField to have a fixed date format ?

like image 275
Janpol Seda Avatar asked Sep 29 '12 19:09

Janpol Seda


1 Answers

You can use JFormattedTextField with SimpleDateFormat

DateFormat format = new SimpleDateFormat("your_format");
JFormattedTextField dateTextField = new JFormattedTextField(format);
like image 109
joval Avatar answered Nov 15 '22 12:11

joval