I'm trying to use images located in the resources folder in a gradle project I just created.
The project tree is as follows:
D:.
├───main
│ ├───java
│ │ └───chess_game_gui
│ │ ├───GameGUI
│ │ ├───MainComponents
│ │ └───Pieces
│ └───resources
└───test
├───java
│ └───chess_game_gui
│ └───app
└───resources
Inside a file that is inside the GameGUI
folder, i have the following line of code:
private static final PieceLabel whitePawn = new PieceLabel(new ImageIcon("../../../resources/white_pawn.png"), Piece.WHITE);
Which is, to my understanding, supposed to get 3 folder up, end up at the main folder, and then access the resources folder. But it fails (the images do not appear in my app. I know it's a problem with the path since I just created this gradle project, it used to work without the gradle project structure.)