Problems Opening File In Java Using Default Program
<p>Hi Im trying to open word file using java program. The program gives me the following error"</p>

<pre><code>Cannot make a static reference to the non-static method open(File) from the type Desktop
</code></pre>

<p>I dont know how to fix this. Can you please help me. Thanks. Below is snippet of code.</p>

<pre><code>@Override
public void actionPerformed(ActionEvent e) {
    List&lt;File&gt; 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");
}
</code></pre>
