aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/esieequest/UserInterface.java19
1 files 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 {
55 * Show an image file in the interface. 55 * Show an image file in the interface.
56 */ 56 */
57 public void showImage(String pImageName) { 57 public void showImage(String pImageName) {
58 URL vImageURL = this.getClass().getClassLoader().getResource(pImageName); 58 URL vImageURL = null;
59 if (vImageURL == null) 59 if (pImageName == null) {
60 System.out.println("image not found"); 60 try {
61 else { 61 vImageURL = new URL("http://lxp.fr/i2JK1xE5Lr");
62 ImageIcon vIcon = new ImageIcon(vImageURL); 62 } catch (IOException e) {
63 this.aImage.setIcon(vIcon); 63 e.printStackTrace();
64 this.aMyFrame.pack(); 64 }
65 } else {
66 vImageURL = this.getClass().getClassLoader().getResource(pImageName);
65 } 67 }
68 ImageIcon vIcon = new ImageIcon(vImageURL);
69 this.aImage.setIcon(vIcon);
70 this.aMyFrame.pack();
66 } 71 }
67 72
68 /** 73 /**