Package org.opentrafficsim.swing.gui
Class OtsControlPanel.RegexFormatter
java.lang.Object
javax.swing.JFormattedTextField.AbstractFormatter
javax.swing.text.DefaultFormatter
org.opentrafficsim.swing.gui.OtsControlPanel.RegexFormatter
- All Implemented Interfaces:
Serializable
,Cloneable
- Enclosing class:
- OtsControlPanel
Extension of a DefaultFormatter that uses a regular expression.
Derived from http://www.java2s.com/Tutorial/Java/0240__Swing/RegexFormatterwithaJFormattedTextField.htm
Derived from http://www.java2s.com/Tutorial/Java/0240__Swing/RegexFormatterwithaJFormattedTextField.htm
- Author:
- Peter Knoppers
-
Constructor Summary
-
Method Summary
Methods inherited from class javax.swing.text.DefaultFormatter
clone, getAllowsInvalid, getCommitsOnValidEdit, getDocumentFilter, getNavigationFilter, getOverwriteMode, getValueClass, install, setAllowsInvalid, setCommitsOnValidEdit, setOverwriteMode, setValueClass, valueToString
Methods inherited from class javax.swing.JFormattedTextField.AbstractFormatter
getActions, getFormattedTextField, invalidEdit, setEditValid, uninstall
-
Constructor Details
-
RegexFormatter
RegexFormatter(String pattern) Create a new RegexFormatter.- Parameters:
pattern
- String; regular expression pattern that defines what this RexexFormatter will accept
-
-
Method Details
-
stringToValue
- Overrides:
stringToValue
in classDefaultFormatter
- Throws:
ParseException
-
toString
-