I am working on a Java GUI, in which i have a JTable in which i have populated my file system, on JTable i have a Right Click Context Menu Like This

i right click on m开发者_Python百科y File and it opens this folders in windows Explorer, to open a file/folder in windows explorer i am using this code
Desktop desktop = Desktop.getDesktop();
    if (Desktop.isDesktopSupported()) {
    }
    try {
        desktop.open(myFile); //myFile is my Selected File
    } catch (IOException e) {
    }
This opens myFile in windows Explorer Like this

i want that it should open windows and my file should be selected in windows explorer.

Thanks
See this: Open the windows explorer with a file selected in eclipse

If you want, for example, select the folder (let's say) C:\myFolder, just replace the arguments with:
/select,C:\myFolder
Do you think you know which options to use? ;)
EDIT: whoops, it looks like you don't call explorer by executing it. Desktop class seems have no support for specifying options/parameters, so I guess this is not doable without using Process class.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论