I'm trying to debug a charm project. I've set break points in the code, but each time execution reaches a break point, Netbeans freezes and I'm obliged to forcefully close it. For what it's worth, I'm using Ubuntu 15.04
[Edit 1]
Here's an image of a set break point
I am getting an exception:
Exception in thread "JavaFX Application Thread" java.lang.IndexOutOfBoundsException
that doesn't point to any line in my code, so I want to debug and get what is causing the problem. Immediately the code gets to line 106, everything freezes.
[Edit 2]
Ok here's most of the controller code.
public void initialize(URL url, ResourceBundle rb) {
departmentList.setPlaceholder(new Label("Oops!! EMPTY!!!"));
/*
Populate SideMenu
*/
ObservableList<Label> schools = FXCollections.observableArrayList();
ListView<Label> schoolList = new ListView<>(schools);
for (School school : schoolsList) {
schools.add(new Label(school.getName(), MaterialDesignIcon.ACCOUNT_BALANCE.graphic()));
}
/*
Add Listeners to side Menu ListView
*/
schoolList.getSelectionModel().selectedItemProperty().addListener(
(ObservableValue<? extends Label> observable, Label oldValue, Label newValue) -> {
selectedSchool = parser.findSchool(newValue.getText());
loadDepartments();
MobileApplication.getInstance().hideLayer("Side Menu");
});
/*
Add Listener to departments ListView
*/
departmentList.getSelectionModel().selectedItemProperty().addListener(
(ObservableValue<? extends Label> observable, Label oldValue, Label newValue) -> {
if (newValue == null) {//Got fired by clearing the Observable list
return;
}
System.out.println(newValue);
facDept[1] = newValue.getText();
/*
Reset before leaving; *to be removed and tried on mobile
*/
loadDepartments();
MobileApplication.getInstance().switchView(SEMESTER_VIEW);
});
borderPane.setCenter(schoolList);
center.getChildren().add(departmentList);
}
@FXML
private void showLayer(ActionEvent event) {
MobileApplication.getInstance().showLayer("Side Menu");
}
I set a break point in the showLayer method(MobileApplication...), and debugging works. I set another one the line selectedSchool = parser.findSchool(newValue.getText());
, but here debugging freezes. Note that the exception doesn't occur here.