0
请告诉我如何以编程方式更改Mac OS X中的桌面背景? 我发现,但对于Windows https://stackoverflow.com/a/12212368/2838676更改桌面背景mac os x
请告诉我如何以编程方式更改Mac OS X中的桌面背景? 我发现,但对于Windows https://stackoverflow.com/a/12212368/2838676更改桌面背景mac os x
public void setWallpaper(File file)
throws Exception {
String as[] = {
"osascript",
"-e", "tell application \"Finder\"",
"-e", "set desktop picture to POSIX file \"" + file.getAbsolutePath() + "\"",
"-e", "end tell"
};
Runtime runtime = Runtime.getRuntime();
Process process;
process = runtime.exec(as);
}
现金
看一看[这](http://stackoverflow.com/questions/19779980/is - 可能的改变桌面背景与java的不同操作)或[这个](http://stackoverflow.com/questions/6199907/change-desktop-background-of- MAC-系统正-使用的Java本机访问) –