代码之家  ›  专栏  ›  技术社区  ›  brian_d

跨平台方法探索文件的包含文件夹

  •  4
  • brian_d  · 技术社区  · 15 年前


    java中是否有跨任何平台打开文件包含文件夹的功能。我可以在windows中通过运行

    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("explorer /select,c:\\sampleFile.txt");
    

    java.awt.Desktop.getDesktop().open(file) . 有没有类似的东西可以培养一个文件管理者?

    1 回复  |  直到 15 年前
        1
  •  7
  •   Burleigh Bear    15 年前

    如果调用getDesktop().open(file.getParentFile()),会发生什么情况?

    推荐文章