0

I am working on one pathology project,I have Two classes,One Is TransactionViewController and Another is UrineExaminationController. Inside both classes there are two methods one is viewUsingLabID and another is Initialize. Now I want to access String LABID from method viewUsingLabID into Initialize method which is in another class.I am stuck here,please help me to get out of this.

Below is my code ,

Method from TransactionViewController

String LABID;


@FXML
   public String viewUsingLabID(ActionEvent actionEvent) throws Exception{
       LABID = lab_id.getText();
       lab_id.setText(LABID);
       UrineExaminationController urineExaminationController = new UrineExaminationController();
       urineExaminationController.sendData(LABID);


}

method from UrineExaminationController,

@Override
   public void initialize(URL url, ResourceBundle rb) {
       sendData(id);
       System.out.println("urine id = "+id);
     }


void sendData(String LABID){
       System.out.println("ididid isisis = "+LABID);
   }
Patrick
  • 53
  • 1
  • 7
  • you can take a look at this answer by me hope it helps http://stackoverflow.com/questions/40128271/problems-with-data-transmission-in-javafx-and-reuse-variables/40144799#40144799 – Rahul Singh Mar 31 '17 at 11:04
  • Thank You so much Sir,it's really help me to solve the issue.Thanks a ton. – Patrick Mar 31 '17 at 13:09
  • please change the edit to rahul no sir :) u are welcome @Patrick – Rahul Singh Mar 31 '17 at 13:20
  • Possible duplicate of [Passing Parameters JavaFX FXML](http://stackoverflow.com/questions/14187963/passing-parameters-javafx-fxml) – fabian Mar 31 '17 at 15:21

0 Answers0