I wish to do what the title says.
Part Solution:
For example in Windows
you can use the code below to open a file in the default explorer and highlight it.
(although it needs modification for files containing spaces
):
/**
* Opens the file with the System default file explorer.
*
* @param path the path
*/
public static void openFileLocation(String path) {
if (InfoTool.osName.toLowerCase().contains("win")) {
try {
Runtime.getRuntime().exec("explorer.exe /select," + path);
} catch (IOException ex) {
Main.logger.log(Level.WARNING, ex.getMessage(), ex);
}
}
}
Useful Links:
Links which are similar but no way dublicates
or not answered:
How to use java code to open Windows file explorer and highlight the specified file?
Open a folder in explorer using Java
How can I open the default system browser from a java fx application?
More explanation:
Is there a way to do it using JavaFX ?
If not at least i need a link or some way to make the app system independence.I mean i don't know the default explorer for every OS that the application is going to work , i need a link or help doing that.
Do i need to write a ton of code to do this?
Is out there any library for doing that?
Do Java9 support that?
Finally:
It is very strange that for so common things i can't find answers and libraries .
Example of highlighted or selected in Windows 10: