posted 10 years ago
Hi to all,I made a project (at Netbeans) with three Jframes.When it runs,it crops two images and make a screenshot for each of them,from two different Jframes. I want to have these two screenshots in the third jframe. How can I load these two screenshots in the third Jframe?
Can anyone help me?
Thank you !
Below,I put a part of my code which is in two Jframes and do screenshots.I think it is helpful for you to understand !
public class Frame1 extends javax.swing.JFrame implements MouseListener, MouseMotionListener {
..........
public void draggedScreen()throws Exception
{
int w = c1 - c3;
int h = c2 - c4;
w = w * -1;
h = h * -1;
Robot robot = new Robot();
BufferedImage img = robot.createScreenCapture(new Rectangle(c1, c2,w,h));
File save_path=new File("right_eye.jpg");
ImageIO.write(img, "JPG", save_path);
System.out.println("Cropped image saved successfully.");
}
.......
}