如何在Java中的Windows资源管理器中获取文件右键菜单 [英] How to get the file right click menu in windows explorer in Java

查看:255
本文介绍了如何在Java中的Windows资源管理器中获取文件右键菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个双面板指挥官。

I am making a twin panel commander.

我制作了两个JTable,用于显示当前目录的内容。我想实现一个右键单击文件将显示Windows资源管理器外壳上下文菜单。

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.

是否有可能?

推荐答案

使用外部应用程序 Runmenu

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

这篇关于如何在Java中的Windows资源管理器中获取文件右键菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆