看到书上一个例子
String filepath = "file:" + System.getProperty("user.dir") +
System.getProperty("file.separator") +
filename;
这里意思是不是用户工作路径,我理解成.jpx工程文件存在的那个目录,可是我把filename为temp.txt放到那个目录以后还是不能打开,就没有人来指点一下吗?55555555555555555
String filepath = "file:" + System.getProperty("user.dir") +
System.getProperty("file.separator") +
filename;
这里意思是不是用户工作路径,我理解成.jpx工程文件存在的那个目录,可是我把filename为temp.txt放到那个目录以后还是不能打开,就没有人来指点一下吗?55555555555555555
IOException - for a null or invalid URL specificationJEditorPane的setPage(String url)
那个参数String是个网址,你试试用www.sina.com.cn代替你的文件,看看有什么效果
以前我通过这个冬冬浏览网页