To give path to a resource eg:- image, in javafx, we can do as :-
ImageView imgView_btnEndCall = new ImageView(new Image("/clientgui/image/callend.png"));
But to give path to a resource in swing, the following code works
FileInputStream fis = new FileInputStream("src/soundtest/sound/sound.wav");
The difference I found is necessity to put 'src' in swing. And when I run the jar file from dist folder, swing program doesnt work but javafx program works. Problem is because the jarfile compress the project including all the packages and files. When javafx program tries to access some resource, it is able to access, callend.png file inside image folder inside clientgui folder. But swing application cant access as we have given 'src' folder in the code. How to solve the problem. How to include the resource directory in swing so that the jar file can access the resource.