0

I will try to be as clear as possible. I have an object ButtonData which have setters and getters. In class InfoController I create an object and, set data to ButtonData. I want to get this data in another class Controllerand use already stored data in class ButtonData, but I can't create a new Object and get information, because it will be clear. How when access to data which is stored in ButtonData?

InfoController:

@FXML
void onSaveClick(ActionEvent event) {
  if(parseInputs()) {
    ButtonData setData = new ButtonData();

    setData.setCode(code);
    setData.setCompany(company);
    setData.setCountry(country);
  }
}

Controller (here I want to get data):

@FXML
void addFlag(ActionEvent event) {
  ButtonData setData = new ButtonData(); //CAN'T DO LIKE THIS!
        
  addingFlag.pinFlag(imageView, anchPane);
  addingFlag.setButtonID(setData.getCode());

  String getCompany = setData.getCompany();
 }
Tamas Hegedus
  • 28,755
  • 12
  • 63
  • 97
Boxify
  • 23
  • 4

0 Answers0