public class Screen1DocumentController implements Initializable {
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
}
@FXML public void handleLogin() throws IOException{
Parent root = FXMLLoader.load(getClass().getResource("Screen2Document.fxml"));
Scene scene = new Scene(root);
Stage stage = new Stage();
stage.setScene(scene);
stage.show();
}
@FXML Button btnLogin;
}
Below Screen2DocumentController.java:
public class Screen2DocumentController implements Initializable {
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// TODO
ReportDetails r;
r = new ReportDetails("pavan");
rptDtls.add(r);
rptDtls.add(new ReportDetails("Viajy"));
rptDtls.add(new ReportDetails("sharat"));
rptDtls.add(new ReportDetails("sandeep"));
rptDtls.add(new ReportDetails("bhaskar"));
rptDtls.add(new ReportDetails("nokal"));
}
private ObservableList<ReportDetails> rptDtls = FXCollections.observableArrayList();
@FXML TableView tblData;
@FXML TableColumn<ReportDetails,String> tblCData;
}
When I click on the login button I am getting run time errors. What am I doing wrong?