@Override public void actionPerformed(ActionEvent e) { if (e.getSource() == ouvrir) try { BufferedImage i = chargeImage(); image.setImage(i); notifyImageListener(i); validate(); repaint(); } catch (AnnulationException err) { } catch (Exception e1) { Outil.erreur("Impossible d'utiliser cette image"); e1.printStackTrace(); } }
public void setImage(BufferedImage img) { image.setImage(img); validate(); repaint(); }
public BufferedImage getImage() throws AnnulationException { if (image.getImage() == null) throw new AnnulationException("Choisir une image"); return image.getImage(); }