Skip to content

Commit

Permalink
add integer only to field
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul P.H. Wilson committed Jun 7, 2015
1 parent 56c01de commit 0564459
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cyclist/src/edu/utexas/cycic/FormBuilderFunctions.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,13 @@ public void changed(ObservableValue<?> observable, Object oldValue, Object newVa
* @return
*/
static TextField lifetimeFieldBuilder(final facilityNode node){
TextField textField = new TextField();
TextField textField = new TextField() {
@Override public void replaceText(int start, int end, String text) {
if (!text.matches("[a-z]")){
super.replaceText(start, end, text);
}
}
};
textField.setText((String)node.facLifetime);

textField.textProperty().addListener(new ChangeListener<String>(){
Expand Down

0 comments on commit 0564459

Please sign in to comment.