嗨我试图用java程序打开word文件。该计划给了我下面的错误”在Java中使用默认程序打开文件的问题
Cannot make a static reference to the non-static method open(File) from the type Desktop
我不知道如何解决这个问题。能否请您帮助我。谢谢。下面是代码片段。
@Override
public void actionPerformed(ActionEvent e) {
List<File> files;
File startingDirectory = new File("C:/Hello/");
try {
files = getFileListing(startingDirectory);
for (File file : files){
Desktop.open(file);
}
} catch (FileNotFoundException ex) {
System.out.println("File Not Found");
}
它工作。感谢束 – Pavel 2012-08-12 23:44:21
很高兴有一个简单的问题,以改变;)很高兴成为协助 – MadProgrammer 2012-08-12 23:47:05