I'm new here and I'm looking for help, I found this way to open files on google chrome with java:
private void abrirVideo(String archivo) {
File arch = new File(archivo);
String comando = "cmd.exe /c start chrome \"" + (archivo) + "\"";
try {
String s = arch.getParent();
Runtime.getRuntime().exec(comando, null, new File(s));
} catch (Exception ex) {
System.out.println("Error abriendo archivo: " + archivo + "\n" + ex);
}
}
and it does work fine, it opens the file in the same window, but the problem I have is that it automatically swaps chrome to the new tab, I've been looking for a couple days on the web and I don't see any post about this. Is there a way to open those files (like pictures, videos, etc...) in chrome in a new tab, without automatically swapping to that new tab. Thank you for your help.