i got a problem with a project i´m doing right now, im working with JavaFx, and I need to pass the text inside of an Label in the class ListController to the class List2Controller, and then show the text in another label on List2Controller. The label in ListController obviously has a text inside.
This is what im doing, but isnt working:
ListController.java
private Label nit;
private String var1;
public void setVar1(String var1)
{
this.var1=var1;
}
public String getVar1()
{
return var1;
}
List2Controller.java
private Label name;
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
String n = null;
ListController f = new ListController();
String valorVar1 = f.getVar1();
name.setText(valorVar1);
}