So, I was watching Smallville (what else is new I know), and Lionel dies??? It was a WTF moment for sure! Lex just upped and pushed him out the window! WOW I was not expecting that! I mean maybe I should have seen it coming? I’m sure the clues have been there all along, it’s been building up to…something? But this? I, I was shocked to say the least! Lionel was starting to grow on me. But if he’s dead? Who knows what will happen next. Part of me is wondering if he was a clone. If he actually faked his death, or had his clone confront Lex because he knew Lex would do something to kill him? I’m not sure. But then again, why would the clone be wearing the locket with the key? So many unanswered questions! On to the next episode!
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