enter code here
I want a Label to transition from not being shown(0.0) to being shown(1.0)
@FXML
private Label welcomeLabel;
public FadeTransition ft = new FadeTransition(Duration.millis(3000));
public void init(){
ft.setNode(welcomeLabel);
ft.setFromValue(0.0);
ft.setToValue(1.0);
ft.setCycleCount(1);
ft.setAutoReverse(false);
ft.play();
}
Here is the app class
package com.ben.main;
public class App extends Application {
private Stage primaryStage;
private Scene loginScene;
LoginUIController loginUIController = new LoginUIController();
public void start(Stage primaryStage) {
this.primaryStage = primaryStage;
initApp();
loginUIController.init();
}
private void initApp() {
Parent root = null;
try {
root = FXMLLoader.load(getClass().getResource("loginUIFXML.fxml"));
} catch (IOException e){
System.err.println("There was an error... " + e);
}
loginScene = new Scene(root);
primaryStage.setTitle("project");
primaryStage.setResizable(false);
primaryStage.setScene(loginScene);
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
Do I have to add it to the scene here as well? I'm having trouble and currently just typing stuff to get the edit updated.