简体   繁体   English

下拉菜单打开蝙蝠文件

[英]Dropdown Menu Opening Bat File

I need some help.I have a Java program with a drop-down menu,there is an option in that menu to launch a test.bat file, what code would I use to specify the system path for it to open test.bat? 我需要一些帮助。我有一个带有下拉菜单的Java程序,该菜单中有一个选项可以启动test.bat文件,我将用什么代码指定它打开test.bat的系统路径? Test.bat is an external file for testing purposes. Test.bat是用于测试目的的外部文件。

EDIT 编辑

This problem has been resolved. 这个问题已经解决。

File f = new File("test.bat");
Desktop.getDesktop().open(f);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM