可编辑
captureScreen.javaas,
public class captureScreen extends Object{ public captureScreen() { .... filename = ".\out.png"; try{Robot robot = new Robot(); ............ } catch(Exception e) { System.out.println("Error"+e); } } public static void main(String args[]){ new captureScreen(); }}使用main实例化另一个功能。



