Desktop: edit(File file) : Desktop « java.awt « Java by API






Desktop: edit(File file)

 
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;

public class Main {
  public static void main(String[] a) {
    try {
      Desktop desktop = null;
      if (Desktop.isDesktopSupported()) {
        desktop = Desktop.getDesktop();
      }

       desktop.edit(new File("c:\\a.txt"));
    } catch (IOException ioe) {
      ioe.printStackTrace();
    }

  }
}

   
  








Related examples in the same category

1.Desktop: browse(URI uri)
2.Desktop: getDesktop()
3.Desktop: isDesktopSupported()
4.Desktop: mail()
5.Desktop: open(File file)
6.Desktop: print(File file)