I am working on a Java GUI in which I have a JTable in which I populated my file system, on JTable I have a context menu in the right click Like This

i right click on my file and it will open these folders in windows explorer to open the 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 it to open windows and my file should be selected in Windows Explorer.

thanks
source share