Update ShipWarfareGUI.java

fixed error with terminal
This commit is contained in:
Vikramb987
2019-03-25 12:25:59 -06:00
committed by GitHub
parent 3ac1087741
commit 6e43912b2e

View File

@@ -16,6 +16,7 @@ import javafx.stage.Stage;
import javafx.util.Duration; import javafx.util.Duration;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.util.Random; import java.util.Random;
import java.util.concurrent.ExecutionException;
/** /**
* 2019-03-10 (Edited on 2019-03-23) * 2019-03-10 (Edited on 2019-03-23)
@@ -445,8 +446,17 @@ public class ShipWarfareGUI extends Player {
centeringUserShipPane.setPrefHeight(200.0); centeringUserShipPane.setPrefHeight(200.0);
centeringUserShipPane.setPrefWidth(200.0); centeringUserShipPane.setPrefWidth(200.0);
Image ourShip = new Image(new FileInputStream("src/images/ourShip.png")); Image ourShip;
Image enemyShip = new Image(new FileInputStream("src/images/enemyShip.png")); 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 //Setting the image view