java program

Anonymous

Question Description

can we create a java program to capture the monitor screen

Tutor Answer

michael12
School: Purdue University

import java.awt.*;
import java.awt.image.*;
import javax.imageio.*;
import java.io.*;

public class ScreenGrab {
public static void main(String[] arg) throws Exception {
Dimension screenDim = Toolkit.getDefaultToolkit().getScreenSize();
Robot robot = new Robot();
BufferedImage image = robot.createScreenCapture(
new Rectangle(0, 0, (int)screenDim.getWidth(),
(int)screenDim.getHeight()));

File fi=new File("ScreenGrab.jpg");
ImageIO.write(image,"jpg",fi);
Toolkit.getDefaultToolkit().beep();
}
}

flag Report DMCA
Review

Anonymous
I was on a very tight deadline but thanks to Studypool I was able to deliver my assignment on time.

Anonymous
The tutor was pretty knowledgeable, efficient and polite. Great service!

Anonymous
Heard about Studypool for a while and finally tried it. Glad I did caus this was really helpful.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors