1
INFORMATION을 사용하여 Alert를 생성했습니다. 그런 다음 TextArea를 만들고 GridPane으로 경고에 추가합니다. 이제 내 질문은 어떻게 경고의 세부 정보를 자동으로 표시 할 수 있습니까?경고의 세부 정보를 자동으로 표시하는 방법은 무엇입니까?
Alert alert = new Alert(AlertType.INFORMATION);
alert.setTitle("TODO Liste");
alert.setContentText("Alle TODO's in der Liste:");
alert.initStyle(StageStyle.UTILITY);
TextArea textArea = new TextArea();
GridPane content = new GridPane();
content.setMaxWidth(Double.MAX_VALUE);
content.add(textArea, 0, 0);
alert.getDialogPane().setExpandableContent(content);
alert.showAndWait();
편집 :
스크린 샷
내가 그렇지 않으면 – xCihat
을 표시하지 않습니다 "쇼보기"를 클릭해야하는 텍스트 영역을 볼 수 당신은 확실히에서 잠금을 가져야한다 좋은 JavaFX 튜토리얼 @ Code Makery - 특히 [JavaFX Dialog] (http://code.makery.ch/blog/javafx-dialogs-official). – SSchuette