我正在尝试调试一个魅力项目。我在代码中设置了断点,但每次执行到达断点时,Netbeans 都会冻结,我不得不强制关闭它。对于它的价值,我使用的是 Ubuntu 15.04
[编辑 1]
这是设置断点的图像
我遇到了一个异常:
Exception in thread "JavaFX Application Thread" java.lang.IndexOutOfBoundsException
它没有指向我的代码中的任何行,所以我想调试并找出导致问题的原因。代码立即到达第 106 行,一切都冻结了。
[编辑 2]
好的,这是大部分控制器代码。
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");
}
我在 showLayer 方法(MobileApplication ...)中设置了一个断点,并且调试工作正常。我在 line 中设置了另一个selectedSchool = parser.findSchool(newValue.getText());
,但这里调试冻结。请注意,此处不会发生异常。