1
我有吹碼,它不起作用,我不明白什麼是問題?爲什麼它不會將圖像添加到流程窗格?
FlowPane flowPane = new FlowPane();
System.out.println("log:brows song");
for (int i = 0; i < 10; i++) {
Image image = new Image(new File("sample/image/2.jpg").toURI().toString());
ImageView imageView = new ImageView(image);
flowPane.getChildren().add(imageView);
}
mainAnchorePaneArtist.getChildren().clear();
mainAnchorePaneArtist.getChildren().add(flowPane);
它清除mainAnchorePaneArtist中的所有節點,但它不會添加流窗格或可能不顯示它!
它會拋出任何異常嗎? – c0der
'File file = new File(「sample/image/2.jpg」); \t System.out.println(file.exists());'可能會輸出false。 – c0der