0
는 내가 hashmap<String, Node>
으로 주요 파일에 화면을 저장하고 내가 갈 때까지 모든 좋은 자바 FX는 IllegalArgumentException (이미 다른 장면의 루트로 설정)
Main screen > Login screen
처럼 보이는 내 응용 프로그램에서 변화하는 장면에 문제가 다시 메인 화면에 로그인 화면에서 여기에 예외 코드, 다시 로그인 화면을로드 할 : 내가 만드는거야 때
java.lang.IllegalArgumentException: [email protected][styleClass=root]is already set as root of another scene
public static final HashMap<String, Parent> pages = new HashMap<>();
@FXML
private void LogIn(ActionEvent event) {
Button button = (Button) event.getSource();
Stage stage = (Stage) button.getScene().getWindow();
if(stage.getScene() != null) {stage.setScene(null);}
Parent root = MyApplication.pages.get("LoginPage");
Scene scene = new Scene(root, button.getScene().getWidth(), button.getScene().getHeight());
stage.setScene(scene);
}
작동 새로운 anchorpane
Parent root = new AnchorPane(MyApplication.pages.get("LoginPage"));
그러나 나는 같은 단계
정말 감사 그게 내 문제 –
@JasonBourne를 해결, 당신은 정답으로이 질문을 표시해야합니다. – Kerry