用OpenFileDialog 打开的文件无法被DocumentBuilder.parse识别程序片断如下
OpenFileDialog fOpenDlg=new OpenFileDialog();
...
File fInputFile=File.open(FopenDlg.getFileName());
...
DocumentBuilder builder=factory.newDocumentBuider();
document=builder.parse(fInputFile); //错误提示:class "DocumentBuilder"doesnt has a method that matches 'parse(File)'...
我该怎么改,救救我吧!
OpenFileDialog fOpenDlg=new OpenFileDialog();
...
File fInputFile=File.open(FopenDlg.getFileName());
...
DocumentBuilder builder=factory.newDocumentBuider();
document=builder.parse(fInputFile); //错误提示:class "DocumentBuilder"doesnt has a method that matches 'parse(File)'...
我该怎么改,救救我吧!
解决方案 »
- 有时候他会卡住在line = reader.readLine()) != null
- 5.0后出现的foreach是必需要出现吗?
- 分享一本不错的书<<The Definitive Guide to Java Swing Edition Third Edition>>
- 关于implements的问题
- java多线程下载文件奇怪问题
- JVM 如何调节最大内存
- 请教关于jmf的问题,请大家帮忙!!!我已经搞了好多天了,还是没有解决
- 哪位大侠有PNG转JPG 算法?
- How can I convert a Char type to a Integer type?
- 求助JCreator Pro 2.0 Build007
- JVM线程同步机制
- 哪里有UDP实现可靠的连接的示例代码?
File.open那里来的???如果你用的swing,那么应该是
JFileChooser jfc;File f=jfc.getSelectedFile();document=builder.parse(f);