tag:blogger.com,1999:blog-1142670628978916041.post6795085515944933949..comments2023-05-16T07:46:09.823-07:00Comments on My JavaFX: Restricting user input on a TextFieldChristian Schudthttp://www.blogger.com/profile/05150185502293392614noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-1142670628978916041.post-510325221287026072015-10-19T09:24:05.393-07:002015-10-19T09:24:05.393-07:00Hi Arthur, sorry, but I've never worked with S...Hi Arthur, sorry, but I've never worked with Scene Builder, so I can't help. But the class is fairly simple, I can't imagine it's a big problem.Christian Schudthttps://www.blogger.com/profile/05150185502293392614noreply@blogger.comtag:blogger.com,1999:blog-1142670628978916041.post-77604729896060444022015-10-18T21:21:00.042-07:002015-10-18T21:21:00.042-07:00Hi Christian,
Can you tell me how to create the c...Hi Christian, <br />Can you tell me how to create the class in FXML add it to Scene Builder ? I want this type of data in several fields, in my user input. Once I insert this class in (say NumberField) in Scene Builder, I would be able to use it wherever I want. Thanks in Advance.<br />HornigoldAnonymoushttps://www.blogger.com/profile/05586243454708453300noreply@blogger.comtag:blogger.com,1999:blog-1142670628978916041.post-64536762483184434452015-08-16T11:41:46.355-07:002015-08-16T11:41:46.355-07:00java 8_40 once you reference your textfield
@FXML...java 8_40 once you reference your textfield<br /><br />@FXML private TextField txtInt;<br />txtInt.textFormatterProperty().setValue(new TextFormatter(new IntegerStringConverter()));Conflict Onehttps://www.blogger.com/profile/09944770272298504785noreply@blogger.comtag:blogger.com,1999:blog-1142670628978916041.post-47017161490514164462015-03-15T22:55:21.932-07:002015-03-15T22:55:21.932-07:00Fyi since Java 8u40 there's a TextFormatter wh...Fyi since Java 8u40 there's a TextFormatter which allows you to filter the text input.RolandChttps://www.blogger.com/profile/15460304377828326132noreply@blogger.comtag:blogger.com,1999:blog-1142670628978916041.post-20661955540382398192014-03-11T03:23:24.584-07:002014-03-11T03:23:24.584-07:00Maybe try (for example):
RestrictedTextField textF...Maybe try (for example):<br />RestrictedTextField textField = new RestrictedTextField();<br />textField.setMaxLength(4);<br /><br />You have, of course, specify some value (maxlength, regex), if you want it to do something.Christian Schudthttps://www.blogger.com/profile/05150185502293392614noreply@blogger.comtag:blogger.com,1999:blog-1142670628978916041.post-12699986005512304822014-03-11T00:40:49.258-07:002014-03-11T00:40:49.258-07:00hi Chris
I create new TextField by FXML.
Then i cr...hi Chris<br />I create new TextField by FXML.<br />Then i create it by TextField textField = new RestrictedTextField(). Can it work?<br />I'm using it but it do nothing :(Anonymoushttps://www.blogger.com/profile/17498860935963398717noreply@blogger.comtag:blogger.com,1999:blog-1142670628978916041.post-16472772241597442013-11-25T06:10:02.042-08:002013-11-25T06:10:02.042-08:00ok, thank you.ok, thank you.Alejandra Cossiohttps://www.blogger.com/profile/15041651652287999858noreply@blogger.comtag:blogger.com,1999:blog-1142670628978916041.post-69819466496091080442013-11-22T11:47:47.284-08:002013-11-22T11:47:47.284-08:00You probably have to replace all your TextField in...You probably have to replace all your TextField instances by RestrictedTextField instances.Christian Schudthttps://www.blogger.com/profile/05150185502293392614noreply@blogger.comtag:blogger.com,1999:blog-1142670628978916041.post-29976882037036614742013-11-22T11:32:05.529-08:002013-11-22T11:32:05.529-08:00Hi, is there a way to use your class with text fie...Hi, is there a way to use your class with text fields? I'm asking cause I have all my forms on fxml and I would like to use your class, is there a way to achive this? <br /><br />ThanksAlejandra Cossiohttps://www.blogger.com/profile/15041651652287999858noreply@blogger.comtag:blogger.com,1999:blog-1142670628978916041.post-35954235814050134752013-10-09T12:05:24.589-07:002013-10-09T12:05:24.589-07:00Dieser Kommentar wurde vom Autor entfernt.Alejandra Cossiohttps://www.blogger.com/profile/15041651652287999858noreply@blogger.comtag:blogger.com,1999:blog-1142670628978916041.post-41284542187277321782013-09-12T14:09:38.848-07:002013-09-12T14:09:38.848-07:00Thanks for the class Christian. I have found it re...Thanks for the class Christian. I have found it really handy. The need for good validation cannot be overstated.Matthew Hhttps://www.blogger.com/profile/05470074194539911911noreply@blogger.comtag:blogger.com,1999:blog-1142670628978916041.post-9959180707122257332013-09-12T14:06:41.653-07:002013-09-12T14:06:41.653-07:00Dieser Kommentar wurde vom Autor entfernt.Matthew Hhttps://www.blogger.com/profile/05470074194539911911noreply@blogger.com