Public static void main (string [] ARGs ){
Try {
String url = "http://www.baidu.com ";
Java.net. Uri uri = java.net. Uri. Create (URL );
// Obtain the current system desktop Extension
Java. AWT. Desktop dp = java. AWT. desktop. getdesktop ();
// Determine whether the system desktop supports the functions to be executed
If (DP. issupported (Java. AWT. desktop. Action. Browse )){
File file = new file ("D: \ aa.txt ");
DP. Edit (File); // edit the file
// DP. Browse (URI); // obtain the default system browser to open the link
// DP. Open (File); // open the file by default
// DP. Print (File); // print the file with a printer
}
} Catch (Java. Lang. nullpointerexception e ){
// An exception is thrown when the URI is null.
E. printstacktrace ();
} Catch (Java. Io. ioexception e ){
// The default browser cannot be obtained.
E. printstacktrace ();
}
}