How do I update an ProgressBar animated? I want to set the progress using a Task and it would be cool if there would be a transition if he updated the progress :-)
Hi, I have made a new video on making more realistic Splash Screen. ua-cam.com/video/f06uUtkmtDE/v-deo.html Instead of using JPEG image as the background (Inside ImageView), Just select a GIF image.You will get animated gif splash screen. I have tried it. :-)
I tried your example on youtube about splash with separate windows, which splash into the menu (you select the table) be set to hide ().I try to apply splash to login is ok but on the login moved to the menu crash occurred due to splash arranged in splashcontroller with layout to hide ().which in my login set to close ().If I make two fxml no problem but when more than 2 fxml certainly problematic.Is JavaFX is problematic with 3 fxml?Because I try to login splash and I use my alerts (fxml) itself is also problematic (not the default alert of JavaFX)Are you able to help you so see how it should apply.Note: I am not able to implement the close () in a splash because it took the event to be taken by the node
Alert alert = new Alert(Alert.AlertType.INFORMATION); alert.setHeaderText(" Informasi Login"); alert.setContentText(" Isian Nama dan Password masih kosong " + " Silahkan diisi terlebih dahulu"); alert.showAndWait();
Thank You very useful for me
How do I update an ProgressBar animated? I want to set the progress using a Task and it would be cool if there would be a transition if he updated the progress :-)
THANK YOU! this was very helpful! How can I use a loading gif for the splash screen (without fade)? When I put it on the stackpane I couldn't see it
Hi,
I have made a new video on making more realistic Splash Screen. ua-cam.com/video/f06uUtkmtDE/v-deo.html
Instead of using JPEG image as the background (Inside ImageView), Just select a GIF image.You will get animated gif splash screen.
I have tried it. :-)
A tip : watch movies at flixzone. Me and my gf have been using them for watching all kinds of movies during the lockdown.
Thank You Sir...
Thanks a Lot................................
it did work but i am gettina troble when the second frame is loaded it is just on one corner
What is the sizeof second frame ?
Is it same as that of first?
you are the best!
Thanks!!!
Thank you. That helped me alot
Thanks buddy its really helpfull
Thank you!
Thank you very much sir
Thank you.
Plzz help me i m getting and exception... Plzz give me ur mail genuine coders..
Link does not work
How use splash screen and then login frame and then main frame, can or not ?
Hi,Of course you can do that!
After the fade-out transition, load your Login fxml file. After successful login, load your main frame fxml.
I tried your example on youtube about splash with separate windows, which splash into the menu (you select the table) be set to hide ().I try to apply splash to login is ok but on the login moved to the menu crash occurred due to splash arranged in splashcontroller with layout to hide ().which in my login set to close ().If I make two fxml no problem but when more than 2 fxml certainly problematic.Is JavaFX is problematic with 3 fxml?Because I try to login splash and I use my alerts (fxml) itself is also problematic (not the default alert of JavaFX)Are you able to help you so see how it should apply.Note: I am not able to implement the close () in a splash because it took the event to be taken by the node
Can you post the code here ?
Main.java
package com.main;
import com.djcom.view.MainMenuController;
import com.djcom.view.LoginController;
import com.djcom.view.SplashController;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class Main extends Application {
private Stage primaryStage;
public AnchorPane firstLayout;
@Override
public void start(Stage primaryStage) {
this.primaryStage = primaryStage;
this.primaryStage.setTitle("Aplikasi Test");
initRootLayout();
}
public void initRootLayout() {
{
FXMLLoader loader = new FXMLLoader();
loader.setLocation(Main.class
.getResource("view/Splash.fxml"));
firstLayout = (AnchorPane) loader.load();
Scene scene = new Scene(firstLayout);
primaryStage.initStyle(StageStyle.UNDECORATED);
primaryStage.setScene(scene);
SplashController controller = loader.getController();
controller.setMain(this);
primaryStage.show();
} catch (IOException e) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, e);
}
}
public void showLogin() {
try {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(Main.class
.getResource("view/Login.fxml"));
AnchorPane page = (AnchorPane) loader.load();
Scene scene = new Scene(page);
primaryStage.setTitle("User Login");
primaryStage.centerOnScreen();
primaryStage.setScene(scene);
primaryStage.show();
LoginController controller = loader.getController();
controller.setMain(this);
} catch (IOException e) {
e.printStackTrace();
}
}
public void showMain() {
try {
FXMLLoader loader = new FXMLLoader();
loader.setLocation(Main.class
.getResource("view/MainMenu.fxml"));
rootLayout = (BorderPane) loader.load();
Scene scene = new Scene(rootLayout);
primaryStage.setScene(scene);
FrameUtamaController controller = loader.getController();
controller.setMain(this);
primaryStage.show();
} catch (IOException e) {
e.printStackTrace();
}
public Stage getPrimaryStage() {
return primaryStage;
}
public static void main(String[] args) {
launch(args);
}
}
SplashController.java
package com.view;
import com.main.Main;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class SplashController implements Initializable {
private Main Main;
private AnchorPane secondLayout;
@FXML
private AnchorPane firstLayout;
@Override
public void initialize(URL url, ResourceBundle rb) {
new SplashScreen().start();
}
public void setMain(Main Main) {
this.Main = Main;
}
class SplashScreen extends Thread {
@Override
public void run(){
try {
Thread.sleep(5000);
Platform.runLater(new Runnable(){
@Override
public void run(){
AnchorPane secondLayout=null;
try{
FXMLLoader loader = new FXMLLoader();
loader.setLocation(Main.class
.getResource("view/Login.fxml"));
secondLayout = (AnchorPane) loader.load();
}catch (IOException ex) {
Logger.getLogger(SplashController.class.getName()).log(Level.SEVERE, null, ex);
}
Scene scene = new Scene(secondLayout);
Stage stagen = new Stage();
stagen.setScene(scene);
stagen.initStyle(StageStyle.UNDECORATED);
stagen.show();
firstLayout.getScene().getWindow().hide();
}
});
} catch (InterruptedException ex) {
Logger.getLogger(SplashController.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
}
LoginController.java
package com.view;
import com.main.Main;
import java.io.IOException;
import java.util.ResourceBundle;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.input.MouseEvent;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class LoginController implements Initializable {
private Main Main;
@FXML
private TextField Username;
@FXML
private TextField Password;
@Override
public void initialize(URL url, ResourceBundle rb) {
}
public void setMain(Main Main) {
this.Main = Main;
}
@FXML
private void actionLogin(MouseEvent event) throws IOException, Exception {
if(Username.getText().trim().equals("")&&Password.getText().trim().equals("")){
Alert alert = new Alert(Alert.AlertType.INFORMATION);
alert.setHeaderText(" Informasi Login");
alert.setContentText(" Isian Nama dan Password masih kosong
"
+ " Silahkan diisi terlebih dahulu");
alert.showAndWait();
Username.requestFocus();
}else if(Username.getText("User")&&Password.getText().trim().equals("qwerty")){
Node node = (Node) event.getSource();
Stage dialogStage_1 = (Stage) node.getScene().getWindow();
dialogStage_1.close();
Main.showMainMenu();
}else {
Alert alert = new Alert(Alert.AlertType.WARNING);
alert.setHeaderText(" Informasi Login");
alert.setContentText("Nama dan Password Salah,
"
+ " Silahkan diulangi");
alert.showAndWait();
Username.requestFocus();
}catch (ClassNotFoundException cnf){
cnf.printStackTrace();
}catch (SQLException se){
se.printStackTrace();
}
}
I've posted his code. How? Whether JavaFX is prolematic when 3 fxml?
Thank You very useful for me