eclipse3.1 + jdk 1.5 + swt designer 桌面应用程序开发
在eclipse中运行程序时 显示图片的位置正确
代码:
File aFile = new File(MySWTLiveNowMain_3.class.getResource("index_new.png").getPath());//
//String path = aFile.getAbsolutePath();
String path = aFile.getPath();但是把整个项目打成exe包运行后报错
“Caused by: java.io.FileNotFoundException: file:\C:\Documents%20and%20Settings\Administrator\Local%20Settings\Temp\e4j25.tmp_dir24260\Java_LiveNow.jar!\com\LiveNow\index_new.png (文件名、目录名或卷标语法不正确。)”
是说这个png图片不存在,可是打开这个相应路径下的包有这个png图片,到底是什么问题呢?
在eclipse中运行程序时 显示图片的位置正确
代码:
File aFile = new File(MySWTLiveNowMain_3.class.getResource("index_new.png").getPath());//
//String path = aFile.getAbsolutePath();
String path = aFile.getPath();但是把整个项目打成exe包运行后报错
“Caused by: java.io.FileNotFoundException: file:\C:\Documents%20and%20Settings\Administrator\Local%20Settings\Temp\e4j25.tmp_dir24260\Java_LiveNow.jar!\com\LiveNow\index_new.png (文件名、目录名或卷标语法不正确。)”
是说这个png图片不存在,可是打开这个相应路径下的包有这个png图片,到底是什么问题呢?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货