Alright, so based on the stuff you've shown here, the best way of doing this that I can think of for you is using getters / setters in the Main class. The reason for this, is because I believe you shouldn't access the GUI everytime you need data, as its an independent object. However, if this approach doesnt suit you, you can always do a singleton.
Getter / Setter design:
public class GUI extends Stage {
private Main instance;
public GUI(Main instance){
this.instance = instance;
}
// Can be any event, such as the start button being pressed.
public void start(){
instance.setTxtBox1(txtBox1.toString()) // whatever is in textbox 1, i forgot the statement to return that
}
}
public class Main {
private String txtBox1;
public static void main(String[] args){
new GUI(this);
}
public String getTxtBox1(){
return txtBox1;
}
public void setTxtBox1(String str){
txtBox1 = str;
}
}