This content has been marked as final. Show 2 replies
johngreig123 wrote:Actually that doesn't make any sense. If you want to run your code on another computer, you don't normally do it by requiring that other computer to install the same IDE you used to write the code. So you normally wouldn't import your project onto a different computer.
I need it to be relative to my project folder(not my computer file system path) so that if I import the project onto a different computer it will open it relative to the project path(URL)
What you would really do in a case like this is to put the HTML file into a directory which is in your classpath. Then you could use code like this:
and you'd have a URL which you could pass to the Desktop class or however you planned to use it.
URL url = getClass().getResource("/thing.html");