List of usage examples for javax.swing.text MaskFormatter setPlaceholder
public void setPlaceholder(String placeholder)
From source file:br.com.pontocontrol.controleponto.util.SwingUtils.java
public static void setMask(JFormattedTextField field, String mask) { try {/* w w w .j a v a 2 s.c o m*/ MaskFormatter maskFormatter = new MaskFormatter(mask); maskFormatter.setPlaceholder(""); maskFormatter.install(field); } catch (ParseException ex) { LOG.log(Level.SEVERE, "Erro ao definir mscara no campo", ex); } }