What Is Going On Jun 24, 2019 What exactly is going on in this life we live in? I do not know. I haven’t the faintest idea of anything that happens. I simply know I am living here and is that enough? Is that enough to make things work? Is it enough to enable life to be something better than it is? I do not know. I simply don’t have any idea of what is going on. I don’t understand or realize any of it. I wish I did. Yet here we are waiting for something better to come around. Something much much better to have an understanding of. Is that not the end goal of life? To better understand each other and ourselves as much as possible?
Sometimes you just need to capture a screenshot in Java. Well look no further here's the code in question!
import java.awt.AWTException;
import java.awt.HeadlessException;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
public class ScreenShot {
public static void main(String[] args) throws IOException {
BufferedImage image;
try {
image = new Robot().createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
ImageIO.write(image, "png", new File("screenshot.png"));
} catch (HeadlessException e) {
e.printStackTrace();
} catch (AWTException e) {
e.printStackTrace();
}
}
}
Comments
Post a Comment