24,922
社区成员
发帖
与我相关
我的任务
分享
public static boolean openFile(File f)
{
if (Desktop.isDesktopSupported())
{
try
{
Desktop.getDesktop().open(f);
//Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler C:\\1.txt");
return true;
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
return false;
}
}
else
{
return true;
}
}