URI url = PhotoEmployee.class.getResource("xxx.jpg").toURI();

File file = new File(url);

BufferedImage bufferedImage = ImageIO.read(file);

 

參考:JavaWorld@TW Java論壇 - 請問如何取得網址中最後一個字串(檔案全名)

全站熱搜
創作者介紹
創作者 fabch2 的頭像
fabch2

小刻家

fabch2 發表在 痞客邦 留言(0) 人氣()