Tuesday 13 May 2014

How to Use Desktop.edit(File file) Method

Name: Hanan Mannan

Name: Hanan Mannan

Created By: Hanan Mannan
Contact Number: Pak (+92)-321-59-95-634
---------------------------------------------
How to Use Desktop.edit(File file) Method
------------------------------------------------------
============================
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
//fb.com/keepprogramming 
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();
}

}
}

1 comment: