Javatpoint Logo
Javatpoint Logo

JavaFX TextField

Text Field is basically used to get the input from the user in the form of text. javafx.scene.control.TextField represents TextField. It provides various methods to deal with textfields in JavaFX. TextField can be created by instantiating TextField class.

Lets see an example where the user is shown the two text boxes and prompted to fill its user-id and password.

Output:


JavaFX TextField

Getting Text field Data

TextField class provides an instance method getText() to retrieve the textfield data. It returns String object which can be used to save the user details in database.

Output:


JavaFX TextField 1





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA