I'm having a little difficulty determining if the path in the code below is a relative path or an absolute path. Also, in this case, I'm trying to open an image I placed inside a folder called "img" which is inside my java project directory. Please don't mind the double backslash (\\), I know these only works on Windows, the only thing I wanted to ask if this path relative or absolute.
ImageView img = new ImageView(new Image("file:img\\square.png"))
In your case, it is relative.
The file: URL scheme refers to a file on the client machine. There is no hostname in the file: scheme; you just provide the path of the file. So, the file on your local machine would be file:///~User/2ndFile.html.
Please read this answer for further information.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.