public void actionPerformed(ActionEvent e)
        {
            String action = e.getActionCommand();
            if (action.equals("SAVE_GRAPH")) {
                String fileName = chooseFile();
                if (fileName == null)
                    return;

                if (!Utilities.getExtension(fileName).equals("png")
                        && !Utilities.getExtension(fileName).equals("PNG"))
                    fileName = fileName + ".png";

                try {
                    File imageFile;
                    FileImageOutputStream outputStream;
                    BufferedImage img;
                    Graphics g;
                    Graphics2D g2d;
                    Rectangle2D r;

                    imageFile = new File(fileName);
                    img = new BufferedImage(
                            (int) (mpdComponent.getPreferredSize().getWidth()),
                            (int) (mpdComponent.getPreferredSize().getHeight()),
                            BufferedImage.TYPE_INT_RGB);

                    g = img.getGraphics();
                    g2d = (Graphics2D) g;

                    g2d.setColor(new Color(255, 255, 255));
                    r = new Rectangle2D.Double(0, 0, img.getWidth(), img
                            .getHeight());
                    g2d.fill(r);

                    mpdComponent.paintComponent(g2d);

                    PNGImageWriter writer = new PNGImageWriter(null);

                    writer.setOutput(outputStream = new FileImageOutputStream(
                            imageFile));
                    writer.write(img);

                    outputStream.close();

                    writer.dispose();

                } catch (IOException err) {
                    GUIUtilities.error("Impossible de sauvegarder le fichier "
                            + fileName);
                }
            }
        }