How to get the file right click menu in windows explorer in Java

孤街浪徒 提交于 2019-12-22 11:37:52

问题


I am making a twin panel commander.

I made two JTables which displays the current directory contents. I would like to implement that a right click on a file would display the windows explorer shell context menu.

Is it somehow possible ?


回答1:


Figured that out with using external app Runmenu.

    String runMenuApp = "path\\to\\runmenu.exe /show "; 
    String file = "\"" + "path\\to\\fileordir" + "\"";
    Process p = Runtime.getRuntime().exec(runMenuApp + file);


来源:https://stackoverflow.com/questions/9546626/how-to-get-the-file-right-click-menu-in-windows-explorer-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!