2014-09-19 3 views
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); 

이 세 문장은 건너 뜁니다.

왜 이런 일이 발생합니까? 누군가의 조언에 감사드립니다!

답변

0

미안하지만, 마침내 알아낼 수 있습니다. 해당 컨트롤러에서 JavaFX Builder로 해당 변수 이름을 수정하기 때문에 일부 변수가 올바르지 않습니다.