Get Started - marconi1992/MaterialComponentsJavaFX GitHub Wiki
Its a Framework that allow add Material Components in JavaFX applications
- Add the controls.css Stylesheet in the Scene object
scene.getStylesheets().add(getClass().getResource("widgets/styles/controls.css").toExternalForm());
- Import the class file that will use in the fxml file.Note:Check if the package name is correct,this depends on the hierarchy of your project and the location of widgets package
<?import materialcomponents.widgets.EditText?>
##Text Field
###Single Line
To create a simple text field is necessary add a "prompText" attribute with the content
<EditText prompText="Nombre de Usuario" />
###Floating Label
To create a simple text field is necessary add a "hint" attribute with the content.
<EditText hint="Nombre de Usuario" />
###Text Area and Password Field
Both support a simple and floating label , to create a text area its textArea attribute must be set true , in the same way to create a Password Field the passwordField attribute must be set true
<EditText passwordField="true" prompText="Contraseña"/>
<EditText passwordField="true" hint="Contraseña"/>
<EditText textArea="true" prompText="Descripción"/>
<EditText textArea="true" hint="Descripción"/>
###Icon
To create a Icon in the text field in the "icon" attribute must be set the path from the svg file
<EditText hint="Nombre de Usuario" icon="@img/image.svg" />