本文实例为大家分享了java实现人工智能化屏幕监控窗口的具体代码,供大家参考,具体内容如下
具体代码实现(含注释)
public class Main{
public static void main(String[] args) throws Exception{
}
public static void mvcontroll() throws Exception{
Jframe frame = new Jframe("人工智能化屏幕监控系统") ;
frame.setSize(600,600) ;
frame.setVisible(true) ;
frame.setAlwaysonTop(true) ;
Toolkit tk = Toolkit.getDefaultToolkit() ;
Dimension dm = tk.getScreenSize() ;
JLabel imageLabel = new JLabel() ;
frame.add(imageLabel) ;
Robot robot = new Robot() ;
while(true) {
BufferedImage bufimg = robot.createScreenCapture(rec)) ;
imageLabel.setIcon(new ImageIcon(bufimg)) ;
}
}
desktop.open(new File(path)) ;
Robot robot = new Robot() ;
robot.delay(2000) ;
robot.mouseMove(709,519) ;
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK) ;
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK) ;
robot.delay(300) ;
}
public static void easyopenQQ(String path) throws Exception{
Desktop desktop = Desktop.getDesktop() ;
desktop.open(new File(path)) ;
}
public static void openBrowse(String uri) throws Exception{
Desktop desktop = Desktop.getDesktop() ;
desktop.browse(new URI("http://www.baidu.com")) ;
}
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



