Como eu faço para alterar o valor de um label Javafx utilizando o valor de uma variavel ?
abaixo segue o codigo
`package termoplayer;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.application.Application;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import java.io.File;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaView;
public class MainApp extends Application implements Initializable {
private Stage primaryStage;
private BorderPane rootLayout;
private static String workingDir = System.getProperty("user.dir");
private static File f = new File(workingDir, "src\\videoteste.mp4");
private static Media m = new Media(f.toURI().toString());
private static MediaPlayer mp = new MediaPlayer(m);
@FXML
MediaView mv = new MediaView(mp);
@FXML
Label lblLabel = new Label();
@Override
public void start(Stage primaryStage) {
this.primaryStage = primaryStage;
this.primaryStage.setTitle("TermoPlayer Itaipava");
initRootLayout();
showPersonOverview();
mv.setPreserveRatio(true);
mp.setCycleCount(MediaPlayer.INDEFINITE);
mp.play();
//Thread t1 = new Thread(new VerificaSerial());
//t1.start() ;
}
/**
* Inicializa o root layout (layout base).
*/
public void initRootLayout() {
try {
// Carrega o root layout do arquivo fxml.
FXMLLoader loader = new FXMLLoader();
loader.setLocation(MainApp.class.getResource("view/RootLayout.fxml"));
rootLayout = (BorderPane) loader.load();
// Mostra a scene (cena) contendo o root layout.
/* final */Scene scene = new Scene(rootLayout);
rootLayout.getChildren().add(mv);
primaryStage.setScene(scene);
primaryStage.setFullScreen(true);
primaryStage.show();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Mostra o person overview dentro do root layout.
*/
public void showPersonOverview() {
try {
// Carrega o person overview.
FXMLLoader loader = new FXMLLoader();
loader.setLocation(MainApp.class.getResource("view/PersonOverview.fxml"));
AnchorPane personOverview = (AnchorPane) loader.load();
// Define o person overview dentro do root layout.
rootLayout.setCenter(personOverview);
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Retorna o palco principal.
*
* @return
*/
public static void main(String[] args) {
launch(args);
System.out.println("TEste aqui ");
}
public Stage getPrimaryStage() {
return primaryStage;
}
public void setPrimaryStage(Stage primaryStage) {
this.primaryStage = primaryStage;
}
public BorderPane getRootLayout() {
return rootLayout;
}
public void setRootLayout(BorderPane rootLayout) {
this.rootLayout = rootLayout;
}
public String getWorkingDir() {
return workingDir;
}
public void setWorkingDir(String workingDir) {
this.workingDir = workingDir;
}
public File getF() {
return f;
}
public void setF(File f) {
this.f = f;
}
public Media getM() {
return m;
}
public void setM(Media m) {
this.m = m;
}
public MediaPlayer getMp() {
return mp;
}
public void setMp(MediaPlayer mp) {
this.mp = mp;
}
public MediaView getMv() {
return mv;
}
public void setMv(MediaView mv) {
this.mv = mv;
}
public Label getLblLabel() {
return lblLabel;
}
public static void setLblLabel(String value) {
lblLabel.setText(value);
}
@Override
public void initialize(URL location, ResourceBundle resources) {
// TODO Auto-generated method stub
}
}`