本文介绍了java中的桌面共享的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想创建一个非常简单的 RMI 代码来共享桌面.
I want to create a very simple RMI code which just share the desktop.
我已经创建了我的类和远程接口.在 Share 类中,我有一个 execute 方法,它将返回客户端桌面的图像.但我不知道如何获得该图像?或如何获得我存储它?请帮助我,谢谢.
I have created my classes and also remote interface.in the Share class ,I have an execute method which will return the image of the client's desktop.but I don't know that how can I get that image ?or how can i store it?please help me,thanks.
分享课程:
class Share implements Task<DesktopPaneUI>,Serializable{
public Share(){
}
public DesktopPaneUI execute() {
}
}
任务类:
public interface Task<T> {
T execute();
}
推荐答案
import java.awt.*
import java.awt.image.*
BufferedImage screenShot = new Robot().createScreenCapture(
new Rectangle(Toolkit.getDefaultToolkit().getScreenSize())
)
这篇关于java中的桌面共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!