我正在尝试调试一个魅力项目。我在代码中设置了断点,但每次执行到达断点时,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 ...)中设置了一个断点,并且调试工作正常。我在行selectedSchool = parser.findSchool(newValue.getText());
中设置另一行,但这里调试冻结了。请注意,此处不会发生异常。