public boolean exists(String path){
        URL imgurl = getClass().getResource(path);
        if(imgurl!=null){
            try {
                ImageIO.read(imgurl);
            } catch (IOException ex) {
                return false;
            }
            return true;
        }else{
            System.err.println("Could not find file2: "+path);
            return false;
        }
    }