JavaFX Material Design JFoenix JFXTextField and JFXPasswordField

Code Source: Class FXMLDocumentController.java  package jfoenix_example; import com.jfoenix.controls.JFXPasswordField; import com.jf...


Code Source:
Class FXMLDocumentController.java 
package jfoenix_example;

import com.jfoenix.controls.JFXPasswordField;
import com.jfoenix.controls.JFXTextField;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javax.swing.JOptionPane;

/**
 *
 * @author amir
 */
public class FXMLDocumentController implements Initializable {
 

        @FXML
    private JFXTextField username;

    @FXML
    private JFXPasswordField password;

    @FXML
    void Login(ActionEvent event) {

        if(username.getText().equals("admin")&&password.getText().equals("12345")){
            JOptionPane.showMessageDialog(null, "username and password is correct");
        }else{
        JOptionPane.showMessageDialog(null, "Fail");
        }
    }
 
    @Override
    public void initialize(URL url, ResourceBundle rb) {
        // TODO
    } 
 
}

FXMLDocument.fxml

<?xml version="1.0" encoding="UTF-8"?>

<?import com.jfoenix.controls.JFXButton?>
<?import com.jfoenix.controls.JFXPasswordField?>
<?import com.jfoenix.controls.JFXTextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="jfoenix_example.FXMLDocumentController">
   <children>
      <JFXButton buttonType="RAISED" layoutX="204.0" layoutY="263.0" onAction="#Login" prefHeight="49.0" prefWidth="193.0" ripplerFill="#dd31c4" style="-fx-background-color: green; -fx-background-radius: 45;" text="Login" textFill="WHITE">
         <font>
            <Font name="Times New Roman Bold" size="25.0" />
         </font>
      </JFXButton>
      <JFXTextField fx:id="username" focusColor="#00f8e8" labelFloat="true" layoutX="180.0" layoutY="95.0" prefHeight="35.0" prefWidth="240.0" promptText="Enter Usrname" unFocusColor="RED" />
      <JFXPasswordField fx:id="password" focusColor="#fff600" labelFloat="true" layoutX="181.0" layoutY="165.0" prefHeight="35.0" prefWidth="240.0" promptText="Enter Password" unFocusColor="#04ff29" />
   </children>
</AnchorPane>


COMMENTS

Name

CSS,3,HTML,3,Java,59,JavaFX,59,JFoenix,15,PHP,4,Scene Builder,29,SQL,9,
ltr
item
Code Amir: JavaFX Material Design JFoenix JFXTextField and JFXPasswordField
JavaFX Material Design JFoenix JFXTextField and JFXPasswordField
https://i.ytimg.com/vi/jf24-F2zq5M/0.jpg
https://i.ytimg.com/vi/jf24-F2zq5M/0.jpg
Code Amir
https://codebyamir.blogspot.com/2020/04/javafx-material-design-jfoenix.html
https://codebyamir.blogspot.com/
https://codebyamir.blogspot.com/
https://codebyamir.blogspot.com/2020/04/javafx-material-design-jfoenix.html
true
405304041427069011
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy