static private void initLoad(JButton load, JPanel panel) {
        load.setToolTipText("To load a new image");
        load.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event) {
                    BufferedImage  newImage = null;
                    String         newName;
                    int ret = fileopen.showDialog(panel, "Open file");

                    if (ret == JFileChooser.APPROVE_OPTION) {
                        File input = fileopen.getSelectedFile();

                        newName = input.getAbsolutePath();
                        try {
                            newImage = ImageIO.read(input);
                        } catch (IOException e) {
                            System.out.println("Could not read the input file: " + newName);
                        }
                        if (newImage != null) {
                            int photoWidth  = newImage.getWidth();
                            int photoHeight = newImage.getHeight();

                            if (!verifyDimensions(photoWidth, photoHeight)) {
                                System.out.println(String.format("Dimensions %s not correct",
                                                                 newName));
                            } else {
                                imageWidth  = photoWidth  / resizeValue;
                                imageHeight = photoHeight / resizeValue;
                                imageInfo.setText(String.format( "Image size: %dx%d, displayed as: %dx%d",
                                                                 photoWidth, photoHeight,
                                                                 imageWidth, imageHeight));
                                currentName = newName;
                                image       = newImage;
                                verifyXAndY();
                                panel.repaint();
                            }
                        }
                    }
                }
            });
    }