static private void initCrop(JButton crop, JPanel panel) {
        crop.setToolTipText("To save the cropped image");
        crop.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event) {
                    int ret = filesave.showDialog(panel, "Open file");

                    if (ret == JFileChooser.APPROVE_OPTION) {
                        BufferedImage dest;
                        JFrame        dispFrame;
                        int           dispHeight = cropHeight * resizeValue;
                        DispImage     dispImage;
                        int           dispWidth  = cropWidth  * resizeValue;
                        File          output     = filesave.getSelectedFile();

                        dest       = image.getSubimage(x * resizeValue, y * resizeValue,
                                                       dispWidth,       dispHeight);
                        dispFrame = new JFrame(output.getName());
                        dispImage = new DispImage(dest, dispWidth, dispHeight);
                        dispFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                        dispFrame.add(dispImage);
                        dispFrame.setSize(dispWidth + 10, dispHeight + 40);
                        dispFrame.setVisible(true);

                        try {
                            ImageIO.write(dest, "JPG", output);
                        } catch (IOException e) {
                            System.out.println("Could not write: " + output.getAbsolutePath());
                        }
                    }
                }
            });
    }