0
내가 알아낼 수없는 클래스 생성자에 fxml 파일을로드 할 때 잘못이다, 내가 디버그이 프로그램 단계,뭔가 내가 문제가 발생할
public Attribution{
FXMLLoader loader;
Group tree;
Scene scene;
AttributionNodeController controller; // This is the corresponding controller
public Attribution() {
try {
System.out.println("Attribution constructor");
loader = new FXMLLoader(Attribution.class.getResource("/view/AttributionNode.fxml"));
tree = loader.load();
controller = loader.getController();
scene = new Scene(tree);
} catch (Exception e) {
}
}
}
을 그리고
loader = new FXMLLoader(Attribution.class.getResource("/view/AttributionNode.fxml"));
이 문장은 다음 꽤 잘 실행되지만
tree = loader.load();
controller = loader.getController();
scene = new Scene(tree);
이 세 문장은 건너 뜁니다.
왜 이런 일이 발생합니까? 누군가의 조언에 감사드립니다!