How to give focus to default program of shell-opened file, from Java ?

Posted by Rabarberski on Stack Overflow See other posts from Stack Overflow or by Rabarberski
Published on 2010-05-04T13:47:27Z Indexed on 2010/05/06 7:18 UTC
Read the original article Hit count: 242

From within Java, I am opening an Excel file with the default file handler (MS Excel, in this case :-) ) using the method described in this stackoverflow question:

Desktop dt = Desktop.getDesktop();
dt.open(new File(filename));

However, the Excel program doesn't get the focus. Is there any easy way to do so?

Edit: There is a related stackoverflow question for C#, but I didn't find any similar Java method.

© Stack Overflow or respective owner

Related posts about java

Related posts about focus