I would like to use a jxdatepicker with maskFormatter. I tried
MaskFormatter maskFormatter = new MaskFormatter ("##/##/####");
JFormattedTextField field=new JFormattedTextField (maskFormatter);
jXDatePicker.setEditor (field);
and
MaskFormatter maskFormatter = new MaskFormatter ("##/##/####");
maskFormatter.install (jXDatePicker.getEditor ());
neither the first nor the second solution worked
PS:
A JFormattedTextField work fine with MaskFormatter
AND jXDatePicker work fine with a simple JFormattedTextField
Personally I'm not very skilled in Java but after checking some docs quickly. I think
setEditoris not the way to go. WithmaskFormatter.installyou seem to go into the right direction. Something like this might help you out:Selective source: JXDatePicker using SimpleDateFormat to format dd.MM.yy to dd.MM.yyyy with current century
Or check out this: https://stackoverflow.com/a/9036979/4820655