简体   繁体   中英

Load image from external jar ,classpath at runtime

i have an application depends on plugins i have a case when i want to load an image from one of my plugins jar

the only way to load the image is

ClassFromPLugin.class.getClassLoader().getResource("image.png");

how can i load the image without using the ClassFromPlugin but use current Component class who need that image

i am loading my jars at runtime , and this specific component who want to load the image don't know where it came from , he just get the image location

thank you

您必须使用ClassLoader加载包含图像的jar。

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM