Package net.cakenet.jsaton.nativedef

Examples of net.cakenet.jsaton.nativedef.WindowReference


        public void actionPerformed(ActionEvent e) {
            String date = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss").format(new Date());
            File f = FileManager.getUserFile("screenshots", date + ".png");
            try {
                WindowReference ref = currentEditor == null ? WindowManager.getDesktop() :
                        currentEditor.script.getTarget();
                BufferedImage img = ref.captureImage().toImage();
                ImageIO.write(img, "PNG", f);
                System.out.println("Screenshot saved as file://" + f.getAbsolutePath());
            } catch (Exception e1) {
                System.out.println("Failed to capture screenshot: " + e1.getLocalizedMessage());
            }
View Full Code Here


    public WindowReference getTarget() {
        return target;
    }

    public void setTarget(WindowReference target) {
        WindowReference oldTarget = this.target;
        this.target = target;
        firePropertyChange("target", oldTarget, target);
    }
View Full Code Here

TOP

Related Classes of net.cakenet.jsaton.nativedef.WindowReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.