我有一個包含許多ImageView節點的網格窗格。當點擊ImageView時,我想刪除圖像。javafx image從圖像移除
ImageView image = new ImageView("https://www.google.co.in/images/nav_logo242.png");
上的動作,我所做的:
image.setImage(null);
System.gc();
但是,我仍然看到舊圖片。
image.getImage(); // it returns null
發表[MCVE(http://stackoverflow.com/help/mcve)。上次我測試它時,這段代碼起作用了。 (即使「我仍然看到較舊的圖像」意思是「圖像存在於內存中」) – fabian