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;
}
填寫數據的TableView在屏幕2以下Screen2DocumentController.java:如何從屏幕截圖1
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;
}
當我點擊登錄按鈕我收到運行時錯誤。我究竟做錯了什麼?
一些堆棧跟蹤將有助於把它! – ItachiUchiha