Try using this:-
this.icon = ImageIO.read(new FileInputStream("res/test.txt"));
where res
folder is present at the same level as your src
folder. Also, if you notice, the slash /
before the res
folder name was removed.
Try using this:-
this.icon = ImageIO.read(new FileInputStream("res/test.txt"));
where res
folder is present at the same level as your src
folder. Also, if you notice, the slash /
before the res
folder name was removed.