-1
我創建ImageIcon的是這樣的:如何獲得ImageIcon的路徑?
ImageIcon ico =new ImageIcon("tree.png");
現在,它可能得到這個路徑字符串?
String path = ico.get ? (?);
我創建ImageIcon的是這樣的:如何獲得ImageIcon的路徑?
ImageIcon ico =new ImageIcon("tree.png");
現在,它可能得到這個路徑字符串?
String path = ico.get ? (?);
嘗試ImageIcon
類的getDescription()
方法。
不要認爲它適用於所有情況,例如,如果您使用Image創建ImageIcon,但它應該在指定文件名/路徑時起作用。
不清楚,請具體多說 –