Good day all, there are 1 Jformattedtextfield (mask formatted) and 1 jcombobox on my program;
The program running well first but ;
If I select item ""; Jformattedtextfield doesn't return to first formatted value even used x.setvalue() or x.setvalue(" / / : "); and program freezes
i think i need to recall the format, some codes from my project as below, thank you for advance ``JFormattedTextField f1 = new JFormattedTextField(new SimpleDateFormat("dd-MM-yyyy HH:mm"));
f1_1 = new JFormattedTextField();
f1_1.setFont(new Font("Calibri", Font.PLAIN, 12));
f1_1.setBounds(88, 97, 104, 30);
panel.add(f1_1);
try {
MaskFormatter dateMask = new MaskFormatter(" ##/##/#### ##:##");
dateMask.install(f1_1);
}
catch (ParseException ex) {
Logger.getLogger(MaskFormatter.class.getName()).log(Level.SEVERE, null, ex);
}`
For the return to the first running condition how it should be ?
if (c1.getSelectedItem().toString() == "")
{
f1_1.setValue(" / / : ");
}