JavaFX Material Design JFoenix Tutorial JFXProgressBar

Class FXMLDocumentController.java package javafxapplication27; import com.jfoenix.controls.JFXProgressBar; import java.net.URL; imp...



Class FXMLDocumentController.java
package javafxapplication27;

import com.jfoenix.controls.JFXProgressBar;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.util.Duration;
import javax.swing.JOptionPane;

/**
 *
 * @author amir
 */
public class FXMLDocumentController implements Initializable {
 
       @FXML
    private JFXProgressBar p1;

    @FXML
    void login(ActionEvent event) {
 
        Timeline timeline = new Timeline();
     
        KeyValue keyvalue1 = new KeyValue(p1.progressProperty(), 0.01);
        KeyFrame frame1 = new KeyFrame(Duration.millis(500), keyvalue1);
     
        KeyValue keyvalue2 = new KeyValue(p1.progressProperty(), 1);
        KeyFrame frame2 = new KeyFrame(Duration.millis(2000), keyvalue2);
     
        timeline.getKeyFrames().addAll(frame1,frame2);
        timeline.play();
        timeline.setOnFinished(e ->{
 
        JOptionPane.showMessageDialog(null, "succes");
    });
    }

    @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.JFXProgressBar?>
<?import com.jfoenix.controls.JFXTextField?>
<?import javafx.scene.layout.AnchorPane?>

<AnchorPane id="AnchorPane" prefHeight="324.0" prefWidth="348.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="javafxapplication27.FXMLDocumentController">
   <children>
      <JFXProgressBar fx:id="p1" layoutX="74.0" layoutY="208.0" progress="0.0" />
      <JFXButton layoutX="148.0" layoutY="252.0" onAction="#login" style="-fx-background-color: green;" text="Login" />
      <JFXTextField layoutX="107.0" layoutY="82.0" />
      <JFXTextField layoutX="107.0" layoutY="137.0" />
   </children>
</AnchorPane>


Class JavaFXApplication27.java
package javafxapplication27;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

/**
 *
 * @author amir
 */
public class JavaFXApplication27 extends Application {
    
    @Override
    public void start(Stage stage) throws Exception {
        Parent root = FXMLLoader.load(getClass().getResource("FXMLDocument.fxml"));
        
        Scene scene = new Scene(root);
        
        stage.setScene(scene);
        stage.show();
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        launch(args);
    }
    
}


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 Tutorial JFXProgressBar
JavaFX Material Design JFoenix Tutorial JFXProgressBar
https://i.ytimg.com/vi/LRFULDUG7yc/0.jpg
https://i.ytimg.com/vi/LRFULDUG7yc/0.jpg
Code Amir
https://codebyamir.blogspot.com/2020/04/javafx-material-design-jfoenix-tutorial_28.html
https://codebyamir.blogspot.com/
https://codebyamir.blogspot.com/
https://codebyamir.blogspot.com/2020/04/javafx-material-design-jfoenix-tutorial_28.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