Cant choose a default path in java when using ImageIcon in Java
问题 Whenever i need to load some image i have difficulties with its path Like i use eclipse and by putting it in src folder and then using this path ImageIcon = new ImageIcon ("/image.png"); It does not load image i need to put it somewhere in my computer and then copy paste its path ....Its not Actually better option as when i tend to run my code in some other computer i need to change the paths of all images in my code back again please help Thanks 回答1: Create "resource" folder into your