Ëæ»ú±£´æͼƬ ¼Ç¼ÄãµÄ״̬ java robot test
ÓÉÓÚºÜÏë»ØÒäÒÔÇ°¸ÉÁËЩʲô£¬×ÜÊÇ»áÔÚij¸öʱ¼ä°ÑÆÁÄ»½Øһϣ¬·½±ãÒÔºó»ØÒä¡£ÓÚÊǾÍдÁ˸ö×Ô¶¯±£´æÆÁÄ»µÄС³ÌÐò¡£
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import javax.imageio.ImageIO;
public class RobotT {
/**
* Main
* <p>
* a robot test
* </p>
*/
public static void main(String[] args) {
RobotT t = new RobotT();
t.run();
}
/*
* auto run
* random save image
*/
private void run(){
try {
//robot to catch screen
Robot ro = new Robot();
//set screen Area
Rectangle rect = initRectangleSize();
while(true){
BufferedImage bufferImage = ro.createScreenCapture(rect);
//set pic name
String picName = String.valueOf(new Date().getTime());
boolean re = ImageIO.write(bufferImage, "png", new File("d:\\pic\\" + picName + ".png"));
//failed to save
if(!re){throw new IOException();}
//set sleep time
Thread.sleep(3000);
}
} catch (Exception e) {
System.out.println("Error !\t"+e.getMessage());
}
}
/**
* initialize Rectangle's Size
* <p>
* initialize Rectangle's Size
* </p>
*
* @return Rectangle screen Area
*/
private Rectangle initRectangleSize(){
//image size
Point point = new Point(1,1);
Dimension dimension = new Dimension(500, 500);
Rectangle rect = new Rectangle(point, dimension);
return rec
Ïà¹ØÎĵµ£º
JAVAµÄÐòÁл¯API£¬ËüÌṩÁËÒ»¸ö¿ò¼Ü£¬ÓÃÀ´½«¶ÔÏó±àÂë³ÉÒ»¸ö×Ö½ÚÁ÷£¬ÒÔ¼°´Ó×Ö½ÚÁ÷±àÂëÖÐÖØй¹½¨¶ÔÏó¡£½«Ò»¸ö¶ÔÏó±àÂë³ÉÒ»¸ö×Ö½ÚÁ÷£¬Õâ¸öÊÇÐòÁл¯¹ý³Ì£¬·´¹ýÀ´¾ÍÊÇ·¹ÐòÁл¯¡£Ò»µ©Ò»¸ö¶ÔÏó±»ÐòÁл¯ºó£¬ÔòËüµÄ±àÂë¿ÉÒÔ´ÓÒ»¸öÕýÔÚÔËÐеÄÐéÄâ»ú±»´«µÝµ½ÁíÍâÒ»¸öÐéÄâ»úÉÏ£¬»òÕß±»´æ´¢ÔÚ´ÅÅÌÉÏ£¬¹©ÒÔºó·´ÐòÁл¯Ê¹Óá£ÐòÁл¯¼¼ÊõÎªÔ ......
7. ÓÃJavaXPCOMÀ´×Ô¶¯ä¯ÀÀÍøÒ³
ÔÚÕâÒ»½ÚÀïÎÒÃǽ«½â¾öһЩ×Ô¶¯ä¯ÀÀÍøÒ³ÖеÄһЩÎÊÌ⣬³¢ÊÔ°ÑÒ»ÏÂͨÓõÄÈÎÎñ³éÏó³ÉÈËÀà¿É¶ÁµÄ·½·¨£¬Òò´ËÄã¿ÉÒÔÇáÒ×µÄÔĶÁ
´úÂë²¢ÖªµÀËüµÄ¹¦ÄÜ¡£ÎÒÃǽ«¹¹½¨Ò»¸öWeb BrowserÀ´¼ÓÔØÍøÒ³£¬µã»÷°´Å¥»òÕß³¬Á´½Ó£¬Ê¹ÓÃXPathÀ´³éÈ¡Ò»ÏÂÓÐÓõÄÐÅÏ¢¡£ÔÚÿһ¸ö
С½ÚÀïÃ棬ÎÒÃǶ¼½«ÔÚÎÒÃǵ ......
7.3 µã»÷ElementºÍÌîд±íµ¥
ÎÒÃÇ¿ÉÒÔ°²È«µÄ¼ÓÔØÒ³Ã棬³éÈ¡ÐÅÏ¢£¬µ«ÊÇÓÐʱä¯ÀÀÍøÒ³ÊÇÐèÒªÌîд±íµ¥²¢Ìá½»»òÕßµã»÷ij¸öÔªËØÀ´´¥·¢onclickÒÔ±ãÖ´ÐÐÒ»¶Î
JavaScript´úÂë¡£
àÅ£¬ÒªÏëµã»÷Ò»¸öelementÐèÒª»ñµÃÕâ¸öelement(Ç°ÃæµÄxpathNodesÒ²Ðí¿ÉÒÔ°ïÎÒÃÇ×öµ½Õâµã)£¬Èç¹ûÊÇinput element£ ......
¿ÉÒÔÓÃ×öcsdn±¸·Ý£¬Õâ¸ö·½·¨À©³äÒÔºó×ö¸öcsdn±¸·Ý¹¤¾ßµ¹ÊDz»´í
package com.tag;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import ja ......
http://www.cnblogs.com/anran_guojianjun/archive/2009/04/14/1435278.html
wait(),notify(),notifyAll()²»ÊôÓÚThreadÀà,¶øÊÇÊôÓÚObject»ù´¡Àà,Ò²¾ÍÊÇ˵ÿ¸ö¶ÔÏñ¶¼ÓÐ
wait(),notify(),notifyAll()
µÄ¹¦ÄÜ.ÒòΪ¶¼¸ö¶ÔÏñ¶¼ÓÐËø,ËøÊÇÿ¸ö¶ÔÏñµÄ»ù´¡,µ±È»²Ù×÷ËøµÄ·½·¨Ò²ÊÇ×î»ù´¡ÁË.
ÏÈ¿´java docÔõô˵:
waitµ¼Öµ± ......