diff --git a/src/ihm/Main.java b/src/ihm/Main.java index b3086b3..14c9a12 100644 --- a/src/ihm/Main.java +++ b/src/ihm/Main.java @@ -28,6 +28,7 @@ public class Main extends Application { } public static void main(String[] args) { + System.err.close(); GestionnaireJeu gj = GestionnaireJeu.getGestionnaireJeu(); launch(args); diff --git a/src/ihm/controller/MenuController.java b/src/ihm/controller/MenuController.java index ff1957c..c71a0ee 100644 --- a/src/ihm/controller/MenuController.java +++ b/src/ihm/controller/MenuController.java @@ -1,8 +1,8 @@ package ihm.controller; -import java.io.FileInputStream; -import java.io.FileNotFoundException; +import java.io.BufferedInputStream; import java.io.IOException; +import java.io.InputStream; import java.net.URL; import java.util.Locale; import java.util.ResourceBundle; @@ -24,21 +24,16 @@ public class MenuController implements Initializable{ @Override public void initialize(URL arg0, ResourceBundle arg1) { - FileInputStream input; - try { - input = new FileInputStream("src\\ihm\\ressources\\img\\logo.png"); + InputStream input; + input = getClass().getResourceAsStream("/ihm/ressources/img/logo.png"); Image image = new Image(input); titre.setImage(image); - - } catch (FileNotFoundException e) { - e.printStackTrace(); - } } @FXML public void commencerPartie(MouseEvent mouseEvent) throws IOException{ System.out.println("Passage à l'écran de choix des joueurs"); - final URL fxmlURL = getClass().getResource("../ressources/Choix_joueur.fxml"); + final URL fxmlURL = getClass().getResource("/ihm/ressources/Choix_joueur.fxml"); final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); AnchorPane pane = fxmlLoader.load(); diff --git a/src/ihm/controller/ParametreController.java b/src/ihm/controller/ParametreController.java index 4ffa3a2..3f86b4b 100644 --- a/src/ihm/controller/ParametreController.java +++ b/src/ihm/controller/ParametreController.java @@ -124,7 +124,7 @@ public class ParametreController implements Initializable { soundEffects.playSoundEffect("src//ihm//ressources//musique//BEEP1.wav"); //emet un bruit sur le bouton si les effets sonores sont activés // Quitter les paramètres - final URL fxmlURL = getClass().getResource("../ressources/Menu.fxml"); + final URL fxmlURL = getClass().getResource("/ihm/ressources/Menu.fxml"); final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane pane = fxmlLoader.load(); diff --git a/src/ihm/controller/PlateauController.java b/src/ihm/controller/PlateauController.java index b5f340f..b73dd60 100644 --- a/src/ihm/controller/PlateauController.java +++ b/src/ihm/controller/PlateauController.java @@ -198,7 +198,7 @@ public class PlateauController implements Initializable { */ public void seReveler(int numJoueur) throws IOException { System.out.println(listJoueur.get(numJoueur).getNom() + " se revele"); - final URL fxmlURL = getClass().getResource("../ressources/Reveler_son_identite.fxml"); + final URL fxmlURL = getClass().getResource("/ihm/ressources/Reveler_son_identite.fxml"); final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Parent root = fxmlLoader.load(); @@ -265,7 +265,7 @@ public class PlateauController implements Initializable { } public void afficherChoisir(Joueur j) throws IOException { - final URL fxmlURL = getClass().getResource("../ressources/choisirBoolean.fxml"); + final URL fxmlURL = getClass().getResource("/ihm/ressources/choisirBoolean.fxml"); final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); Pane root = (Pane)fxmlLoader.load(); diff --git a/src/ihm/controller/PlayersController.java b/src/ihm/controller/PlayersController.java index c585331..8e64e80 100644 --- a/src/ihm/controller/PlayersController.java +++ b/src/ihm/controller/PlayersController.java @@ -122,7 +122,7 @@ public class PlayersController implements Initializable{ GestionnaireJeu gj = GestionnaireJeu.getGestionnaireJeu(); gj.setConfiguration(new Configuration(this.joueurs)); - final URL fxmlURL = getClass().getResource("../ressources/PlateauTest2.fxml"); + final URL fxmlURL = getClass().getResource("/ihm/ressources/PlateauTest2.fxml"); final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRENCH); final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle); AnchorPane root = fxmlLoader.load();