且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在java中打开windows资源管理器

更新时间:2023-02-04 16:25:48

我不知道它在其他操作系统,但在Windows中,您可以使用这样的东西

I am not sure how it works in other OS but in Windows you can use something like this

Desktop.getDesktop().open(new File("c:\\"));



编辑



找到其他方式(从该答案中检查链接到FileExplorer类)。还可以使用 System.getProperty(os.name)来确定操作系统。

Edit

Found another way (check link to FileExplorer class from that answer). Also you can use System.getProperty("os.name") to determine operation system.