开发者

How do I access a JPG embedded in my JAR file via a URL object? What would be the address?

开发者 https://www.devze.com 2022-12-28 21:46 出处:网络
I\'ve bundled a JPG inside of my application\'s JAR file.I need to access it, preferably via a URL objec开发者_Python百科t from the code in the same JAR.But I\'ve no idea how to construct the address.

I've bundled a JPG inside of my application's JAR file. I need to access it, preferably via a URL objec开发者_Python百科t from the code in the same JAR. But I've no idea how to construct the address. I'm guessing it would be a "file:///" but what comes after that?


You can use ClassLoader.getResource, specifying a slash-delimited resource path.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号