Java Swing ImageIcon, where to put images?
问题 I'm following this tutorial for java swing games: http://zetcode.com/tutorials/javagamestutorial/movingsprites/ At this point: ImageIcon ii = new ImageIcon(this.getClass().getResource()); image = ii.getImage(); I just don't know what kind of path I have to write and where should I save my images (which directory). Would you help me please? Would you give an example? 回答1: In your src folder, create a folder called "images" or "files" then put the image in there. Then use this: ImageIcon(this