Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Windows Media Player 11 and Java

807591Feb 29 2008 — edited Feb 29 2008
Hi! I'm trying to launch Windows Media Player 11 on Windows Vista Home Premium from a java program. I tried this:
String path = "C:" + File.separator + "Users" + File.separator + "John" + File.separator + "Videos" + File.separator + "Movies"  +                    File.separator + "Babel.avi";
String cmd = "wmplayer " + path + " /fullscreen";

Process p = Runtime.getRuntime().exec(cmd);
It doesn't work but it I try to launch Notepad it works. What am I doing wrong?

Also, is it possible for a Java program to give focus to another running program? For example, I want to launch Notepad using the Runtime class and then pass focus to the open Notepad document and use a robot to simulate input.

Thank you in advance for your help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 28 2008
Added on Feb 29 2008
6 comments
120 views