    import javax.swing.*;
    import javax.swing.text.*;

    import java.awt.Toolkit;
    import java.text.*;
    import java.util.Locale;

    public class _70 extends PlainDocument {
        private Format _71;

        public _70(Format _72) {
            _71 = _72;
        }

        public Format _73() {
            return _71;
        }

        public void insertString(int _74, String _75, AttributeSet _76)
            throws BadLocationException {

            String _77 = getText(0, getLength());
            String _78 = _77.substring(0, _74);
            String _79 = _77.substring(_74, _77.length());
            String _80 = _78 + _75 + _79;

            try {
                _71.parseObject(_80);
                super.insertString(_74, _75, _76);
            } catch (ParseException _81) {
                Toolkit.getDefaultToolkit().beep();
                System.err.println("insertString: could not parse: "
                                   + _80);
            }
        }

        public void remove(int _82, int _83) throws BadLocationException {
            String _84 = getText(0, getLength());
            String _85 = _84.substring(0, _82);
            String _86 = _84.substring(_83 + _82, _84.length());
            String _87 = _85 + _86;

            try {
                if (_87.length() != 0) _71.parseObject(_87);
                super.remove(_82, _83);
            } catch (ParseException _88) {
                Toolkit.getDefaultToolkit().beep();
                System.err.println("remove: could not parse: " + _87);
            }
        }
    }