java program

Anonymous
timer Asked: Jul 3rd, 2013
account_balance_wallet $5

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
Thank you! Reasonably priced given the quality not just of the tutors but the moderators too. They were helpful and accommodating given my needs.

Similar Questions
Hot Questions
Related Tags
Study Guides

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