From 6e43912b2eca7d6a940195655c187b31244aadea Mon Sep 17 00:00:00 2001 From: Vikramb987 <47336882+Vikramb987@users.noreply.github.com> Date: Mon, 25 Mar 2019 12:25:59 -0600 Subject: [PATCH] Update ShipWarfareGUI.java fixed error with terminal --- src/ShipWarfareGUI.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ShipWarfareGUI.java b/src/ShipWarfareGUI.java index f1839fa..a322700 100644 --- a/src/ShipWarfareGUI.java +++ b/src/ShipWarfareGUI.java @@ -16,6 +16,7 @@ import javafx.stage.Stage; import javafx.util.Duration; import java.io.FileInputStream; import java.util.Random; +import java.util.concurrent.ExecutionException; /** * 2019-03-10 (Edited on 2019-03-23) @@ -445,8 +446,17 @@ public class ShipWarfareGUI extends Player { centeringUserShipPane.setPrefHeight(200.0); centeringUserShipPane.setPrefWidth(200.0); - Image ourShip = new Image(new FileInputStream("src/images/ourShip.png")); - Image enemyShip = new Image(new FileInputStream("src/images/enemyShip.png")); + Image ourShip; + Image enemyShip; + + try { + ourShip = new Image(new FileInputStream("src/images/ourShip.png")); + enemyShip = new Image(new FileInputStream("src/images/enemyShip.png")); + + }catch(Exception e){ + ourShip = new Image(new FileInputStream("images/ourShip.png")); + enemyShip = new Image(new FileInputStream("images/enemyShip.png")); + } //Setting the image view