Hi All,

I have done image crop using ImageCropper.After that i want to store in my disk. I want to know how to store the image.The below code is used for awt.and its drawing the image...intead of drawing i want to store in physical location.please help me in this.
My Code:


XML Code:
import java.awt.*;
import javax.imageio.ImageIO;
import javax.imageio.stream.FileImageInputStream;
import javax.swing.*;
import org.apache.struts.upload.FormFile;
import java.awt.image.CropImageFilter;
import java.awt.image.FilteredImageSource;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Date;

public class CropImage extends JFrame {
  Image image;
  Insets insets;

  public CropImage() throws IOException {
    super("Crop Image");
    ImageIcon icon = new ImageIcon("D:\\Cropped\\Image_24953726220091348.jpg");
    image = icon.getImage();
    image = createImage(new FilteredImageSource(image.
       getSource(),new CropImageFilter(75, 70, 140, 150)));
    
     }
  public void paint(Graphics g) {
    super.paint(g);
    if (insets == null) {
      insets = getInsets();
    }
    g.drawImage(image, insets.left, insets.top, this);
  }
  public static void main(String args[]) throws IOException {
    JFrame frame = new CropImage();
    frame.setSize(250, 250);
    frame.show();
  }
}