import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.imageio.ImageIO;
import java.awt.event.*;
public class pro extends Frame{
BufferedImage img;
public static void main(String[] args) {
Frame f=new pro();
f.setTitle("game");
f.setSize(500,500);
f.setVisible(true);
}
pro(){
try {
Rectangle bounds = new Rectangle(0, 0, 500, 500);
Robot robot = new Robot();
img = robot.createScreenCapture(bounds);
}
catch (AWTException e) { e.printStackTrace(); }
addWindowListener(new stopwin());
}
class stopwin extends WindowAdapter{
public void windowClosing(WindowEvent we){System.exit(0);}
}
public void paint(Graphics g){
g.drawImage(img,0, 0,500,500,this);
}
}
最終更新:2011年09月22日 09:43