下面的当前路径都是你的工程目录 File file =new File("./xml/a.properties") ; 中的./xml/a.properties中的.是指当前路径哪么这句就是当前路径下的xml下的a.properties File file1 =new File("xml/a.properties") ; 中的xml/a.properties也代表了它会在当前路径下找xml然后找xml下的a.properties File file2 =new File("/xml/a.properties") ;而这个中的/xml/a.properties表示绝对路径。在linux下他表示在xml文件下的a.properties而不是当前文件夹下的!windows的这个路径表示Class文件所在路径
这个中的图片应该如何调用 ImageIcon ii = new ImageIcon("./CS/src/res/7.jpg");ImageIcon ii = new ImageIcon("./src/res/7.jpg");. 指当前目录 代表工程文件