Here you can find the source of createFormatter(String s)
public static MaskFormatter createFormatter(String s)
//package com.java2s; import javax.swing.text.MaskFormatter; public class Main { public static MaskFormatter createFormatter(String s) { MaskFormatter formatter = null; try {/*from ww w .ja va 2 s.c o m*/ formatter = new MaskFormatter(s); } catch (java.text.ParseException exc) { System.err.println("formatter is bad: " + exc.getMessage()); System.exit(-1); } return formatter; } }