image = new JLabel(new ImageIcon("C:\\Users\\user\\AutoTextSum\\src\\autotextsum\\newImage.JPG"));
As you can see from the instantiation on the label above, I've used a static file referencing whereby I explicitly indicates the physical location. Let say this coding file name is autotextsum.java. How do I put the image without the need to explicitly indicates the file name?
image = new JLabel(new ImageIcon("newImage.JPG"));
I've tried this, but it just won't work. The main cause that I need to change the addressing mode because I need to create a .jar file, in which, the .jar needs to work in any other java enabled PC. But, the newImgae.JPG won't be at C:\Users\user\AutoTextSum\src\autotextsum in any other random PC.
P/S: autotextsum.java and newImage.JPG is in the same folder.