Here you can find the source of createMaskFormatter(final String s)
public static MaskFormatter createMaskFormatter(final String s)
//package com.java2s; // License as published by the Free Software Foundation; either import java.text.ParseException; import javax.swing.text.MaskFormatter; public class Main { public static MaskFormatter createMaskFormatter(final String s) { MaskFormatter formatter = null; try {// w w w . j a v a 2s . c o m formatter = new MaskFormatter(s); } catch (final ParseException e) { throw new IllegalArgumentException(e); } return formatter; } }