I'm trying to create a screen capture program.
I have a transparent window, which will capture the area on a button is executed individually by using a command prompt I have I tried to put in and And touching the Here is my and All your suggestions, comments, recommendations are welcome and commendable. Please help me solve this problem Thank you. You need to use effort / catch, so there are not many errors in the form of those warnings. For, put around a code that has AWTException: and: Or combine both: For further reading, this can help clarify the exception: capture , and I try to instantiate a class
captureScreen I'm doing a good job on
captureScreen
captureScreen When the button
Capture is hit by the class, I am trying to instantiate.
class on my
screenrecord.java , put the code in the
event listener is. In both of these cases, I get these errors
AWTException should be caught or declared
< Code> robot robot = new robot (); IOException in line
BufferedImage image .
screen. Java does not contain anything different.
System.out.println ("Start"); will also not print anything.
screenrecord.java code
the public square screenorder applied to GeFrame ActionListener {public screenrecord () {...} Public Zero Functionality (if ("record" .equals (e.getActionCommand ())) {capture screen = a new capture screen (); }}}
captureScreen.java , works fine individually.
extends the public class capture screen object {public static zero main (string agr []) {... robot robot = new robot (); Buffet image image = robot.createcrescapture (screenrecognally); ImageIO.write (image, "PNG", new file (filename)); Println ("full"); }}
try {// code cause AWTException Robot Robot = new robot (); } Hold (AWTException e) {System.out.println ("Error" + e); }
try {// code due to IOException BufferedImage image = robot.createScreenCapture (screenRectangle); } Hold (IOException e) {System.out.println ("error" + e); }
try {// code whereby AWTException or IOException robot robot = new robot (); Buffet image image = robot.createcrescapture (screenrecognally); } Hold (IOException e) {System.out.println ("error" + e); } Hold (AWTException e) {System.out.println ("Error" + e); }
No comments:
Post a Comment