From e38a8ebb5fbb85082297a25b1fcf29283b599114 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Mon, 24 Feb 2014 20:11:24 +0100 Subject: Add image placeholder --- src/esieequest/UserInterface.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/esieequest/UserInterface.java b/src/esieequest/UserInterface.java index 1621bc5..4f3e19e 100644 --- a/src/esieequest/UserInterface.java +++ b/src/esieequest/UserInterface.java @@ -55,14 +55,19 @@ public class UserInterface implements ActionListener { * Show an image file in the interface. */ public void showImage(String pImageName) { - URL vImageURL = this.getClass().getClassLoader().getResource(pImageName); - if (vImageURL == null) - System.out.println("image not found"); - else { - ImageIcon vIcon = new ImageIcon(vImageURL); - this.aImage.setIcon(vIcon); - this.aMyFrame.pack(); + URL vImageURL = null; + if (pImageName == null) { + try { + vImageURL = new URL("http://lxp.fr/i2JK1xE5Lr"); + } catch (IOException e) { + e.printStackTrace(); + } + } else { + vImageURL = this.getClass().getClassLoader().getResource(pImageName); } + ImageIcon vIcon = new ImageIcon(vImageURL); + this.aImage.setIcon(vIcon); + this.aMyFrame.pack(); } /** -- cgit v1.2.3