Wednesday, 3 April 2013

Decimal values TextField  In JavaFx

For decimal value text field in JavaFx use textfield event in this way

textField.addEventFilter(KeyEvent.KEY_TYPED,
                new EventHandler<KeyEvent>() {
                    public void handle(KeyEvent t) {
                        char ar[] = t.getCharacter().toCharArray();
                        char ch = ar[t.getCharacter().toCharArray().length - 1];
                        if (!((ch >= '0' && ch <= '9')|| ch=='.'))
                            t.consume();
                    }
                });

1 comment:

  1. Playtech casino slot machine - DrMD
    A simple, simple and simple game 강릉 출장마사지 for the casino will 인천광역 출장샵 help you 양주 출장안마 relax while enjoying a slot machine. This is not all the  부천 출장안마 Rating: 4 · ‎1 춘천 출장마사지 review

    ReplyDelete