Ajuda com o JFormattedTextField

0 respostas
R

Oi,

Adicionei dois jFormattedTextField (jTelef e um jDat) no meu frame. criei as máscaras e no evento formComponentShown executo o método Mascara(), mas não acontece nada.

import java.text.ParseException;
import javax.swing.JFormattedTextField;
import javax.swing.text.MaskFormatter;


 private MaskFormatter fTelefone;
 private MaskFormatter fData;


public void Mascara() throws ParseException{

  fTelefone = new MaskFormatter("####-####");
  fData = new MaskFormatter("##/##/####");
			
  jTelef = new JFormattedTextField(fTelefone);
  jDat = new JFormattedTextField(fData);

}
Criado 2 de setembro de 2008
Respostas 0
Participantes 1